Merge pull request #4936 from betagouv/fix-champ-localization

locales: fix translation of champ value
This commit is contained in:
Paul Chavard 2020-03-24 15:47:29 +01:00 committed by GitHub
commit b8cbe55ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -2,8 +2,8 @@ class Champs::DecimalNumberChamp < Champ
validates :value, numericality: {
allow_nil: true,
allow_blank: true,
message: -> (object, data) {
"« #{object.libelle} » " + object.errors.generate_message(data[:attribute].downcase, :not_a_number)
message: -> (object, _data) {
"« #{object.libelle} » " + object.errors.generate_message(:value, :not_a_number)
}
}

View file

@ -3,8 +3,8 @@ class Champs::IntegerNumberChamp < Champ
only_integer: true,
allow_nil: true,
allow_blank: true,
message: -> (object, data) {
"« #{object.libelle} » " + object.errors.generate_message(data[:attribute].downcase, :not_an_integer)
message: -> (object, _data) {
"« #{object.libelle} » " + object.errors.generate_message(:value, :not_an_integer)
}
}

View file

@ -1,5 +1,5 @@
fr:
activerecord:
attributes:
champs:
champ:
value: La valeur du champ