Browse Source

Update app/models/validations/date_validations.rb

Co-authored-by: baarkerlounger  <5101747+baarkerlounger@users.noreply.github.com>
pull/683/head
Dushan 3 years ago committed by Dushan Despotovic
parent
commit
c664de5840
  1. 2
      app/models/validations/date_validations.rb

2
app/models/validations/date_validations.rb

@ -40,7 +40,7 @@ module Validations::DateValidations
end end
if record.scheme_id.present? if record.scheme_id.present?
scheme_end_date = Scheme.find(record.scheme_id).end_date scheme_end_date = record.scheme.end_date
if scheme_end_date.present? && (record.startdate > scheme_end_date) if scheme_end_date.present? && (record.startdate > scheme_end_date)
record.errors.add :startdate, I18n.t("validations.setup.startdate.before_scheme_end_date") record.errors.add :startdate, I18n.t("validations.setup.startdate.before_scheme_end_date")
end end

Loading…
Cancel
Save