fix(Champs::DecimalNumberChamp): validates Champs::DecimalNumberChamp respecting it's validation context

This commit is contained in:
mfo 2024-03-29 12:25:24 +01:00
parent b07bbfa455
commit 04f3b6a844
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
2 changed files with 22 additions and 11 deletions

View file

@ -14,7 +14,7 @@ class Champs::DecimalNumberChamp < Champ
message: -> (object, _data) {
"« #{object.libelle} » " + object.errors.generate_message(:value, :not_a_number)
}
}
}, if: -> { validate_champ_value? || validation_context == :prefill }
def for_export
processed_value