This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validates_each :date_expire, on: :create, if: ->(r) { r.is_company? } do |record, attr, value| | |
record.errors.add attr, 'must be in the future ' if value < Date.today | |
end |
No comments:
Post a Comment