fix number cast empty string
This commit is contained in:
@@ -93,7 +93,11 @@ module Submitters
|
||||
if params[:cast_boolean] == 'true'
|
||||
v == 'true'
|
||||
elsif params[:cast_number] == 'true'
|
||||
(v.to_f % 1).zero? ? v.to_i : v.to_f
|
||||
if v == ''
|
||||
nil
|
||||
else
|
||||
(v.to_f % 1).zero? ? v.to_i : v.to_f
|
||||
end
|
||||
elsif params[:normalize_phone] == 'true'
|
||||
v.to_s.gsub(/[^0-9+]/, '')
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user