app/models/plan.rb
# Validation to prevent end date from coming before the start date
Validation to prevent end date from coming before the start date
Validation to prevent end date from coming before the start date
def end_date_after_start_date
    return true if end_date.blank? || start_date.blank? || end_date > start_date
    errors.add(:end_date, _("must be after the start date"))
  end
def end_date_after_start_date return true if end_date . blank? || start_date . blank? || end_date > start_date errors . add ( :end_date , _ ( "must be after the start date" ) ) end
Validation to prevent end date from coming before the start date
Validation to prevent end date from coming before the start date
# allow nil values