This file contains hidden or 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
Place this file in your config/initializers | |
class CheckDate < ActiveModel::Validator | |
#Sat Jan 01 00:00:00 UTC 2000 is the default date that rails store | |
def validate(record) | |
if record.start_time == "Sat Jan 01 00:00:00 UTC 2000".to_date | |
record.errors[:base] << "This is a invalid date" | |
end | |
end |
NewerOlder