On Friday, 25 July 2014 23:21:08 UTC-4, Ricky Hopkins wrote:
I am trying to convert an integer to a DAYNAME in my validation message
validates_uniqueness_of :day, scope: :store, :message = already has a
target for #{Date::DAYNAMES[self.day]}.
This does not seem to work, I cannot access
This is along the lines of what Matt is referring to.
class DayValidator ActiveRecord::Validator
def validate()
if YOUR_TEST_FOR_INVALIDITY(record.day)
date = Date::DAYNAMES[record.day]
record.errors[:day] already has a target #{date}
end
end
end
class YourClass
2 matches
Mail list logo