[Fix #2623] Ensure numbers are integers
This commit is contained in:
parent
dd76c068fc
commit
68789ff43b
2 changed files with 7 additions and 1 deletions
|
@ -1,2 +1,6 @@
|
|||
class Champs::NumberChamp < Champ
|
||||
validates :value, numericality: { message: Proc.new { |champ, _| "#{champ.libelle} doit être un nombre" } }
|
||||
validates :value,
|
||||
numericality: { only_integer: true, message: Proc.new { |champ, _| "#{champ.libelle} doit être un nombre entier" } },
|
||||
if: Proc.new{ |object| object.errors.empty? }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue