ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
450 B

  1. class PostVersion < ApplicationRecord
  2. include VersionRecord
  3. belongs_to :post
  4. validates :url, presence: true
  5. validate :validate_original_created_range
  6. private
  7. def validate_original_created_range
  8. f = original_created_from
  9. b = original_created_before
  10. return if f.blank? || b.blank?
  11. if f >= b
  12. errors.add :original_created_before, 'オリジナルの作成日時の順番がをかしぃです.'
  13. end
  14. end
  15. end