VALIDATE START DATE END DATE
validate :end_date_after_start_date?
def end_date_after_start_date?
if end_date.present?
if end_date < start_date
errors.add :end_date, "must be after start date"
end
end
end
def end_date_after_start_date?
if end_date.present?
if end_date < start_date
errors.add :end_date, "must be after start date"
end
end
end
Comments
Post a Comment