SyntaxFix
Write A Post
Hire A Developer
Questions
Here's a non-chronic answer..
class Pimping < ActiveRecord::Base validate :valid_date? def valid_date? if scheduled_on.present? unless scheduled_on.is_a?(Time) errors.add(:scheduled_on, "Is an invalid date.") end end end