Skip to content

Commit

Permalink
use translations for error message
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo Melo <[email protected]>
  • Loading branch information
squanto committed Feb 20, 2025
1 parent cc00a54 commit fd87c4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/date_accessible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def self.date_writer(*properties)
define_method("#{property}_date_valid") do
date = send(property)
if date.present? && !Date.valid_date?(date.year, date.month, date.day)
errors.add(property, :invalid_date, message: "is not a valid calendar date")
errors.add(:date_of_contribution, :invalid_date, message: I18n.t("activerecord.errors.models.az321_contribution.attributes.date_of_contribution.inclusion"))
end
end
end
Expand Down

0 comments on commit fd87c4b

Please sign in to comment.