Fix number champs validation
This commit is contained in:
parent
034b3f600b
commit
ca147969ab
4 changed files with 26 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
class Champs::DecimalNumberChamp < Champ
|
||||
validates :value, numericality: { allow_nil: true }
|
||||
validates :value, numericality: { allow_nil: true, allow_blank: true }
|
||||
|
||||
def value_for_export
|
||||
value.to_f
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Champs::IntegerNumberChamp < Champ
|
||||
validates :value, numericality: { only_integer: true, allow_nil: true }
|
||||
validates :value, numericality: { only_integer: true, allow_nil: true, allow_blank: true }
|
||||
|
||||
def value_for_export
|
||||
value.to_i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue