Skip to content

Commit

Permalink
Check if the date valid before running location validations
Browse files Browse the repository at this point in the history
  • Loading branch information
kosiakkatrina committed Feb 4, 2025
1 parent dba2998 commit 270999b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/validations/setup_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def validate_location(record)
end

def location_during_startdate_validation(record)
return unless date_valid?("startdate", record)

location_inactive_status = inactive_status(record.startdate, record.location)

if location_inactive_status.present?
Expand All @@ -108,6 +110,8 @@ def location_during_startdate_validation(record)
end

def scheme_during_startdate_validation(record)
return unless date_valid?("startdate", record)

scheme_inactive_status = inactive_status(record.startdate, record.scheme)

if scheme_inactive_status.present?
Expand Down

0 comments on commit 270999b

Please sign in to comment.