Skip to content

Commit

Permalink
Localize invalid message for Date of Birth
Browse files Browse the repository at this point in the history
  • Loading branch information
padv2010 committed Jun 22, 2023
1 parent 4e7ac2b commit 37e72ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/applicants/personal_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def date_of_birth_not_in_future
def age_less_than_maximum
return unless date_of_birth.present? && (Date.current.year - date_of_birth.year) >= MAX_AGE

errors.add(:date_of_birth, "age should be below #{MAX_AGE} years")
errors.add(:date_of_birth)
end
end

Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ en:
invalid: Enter a telephone number, like 07700 900 982 or +34 626 587 210’
date_of_birth:
blank: Enter your date of birth
invalid: Age must be below 80
sex:
blank: Enter your sex
passport_number:
Expand Down

0 comments on commit 37e72ab

Please sign in to comment.