mirror of
https://github.com/docusealco/docuseal
synced 2026-11-10 23:42:32 -05:00
fix number cast empty string
This commit is contained in:
1 parent
f2fd5fb82b
commit
599785b6d1
1 file changed
+5
-1
@@ -93,7 +93,11 @@ module Submitters
|
|||||||
if params[:cast_boolean] == 'true'
|
if params[:cast_boolean] == 'true'
|
||||||
v == 'true'
|
v == 'true'
|
||||||
elsif params[:cast_number] == '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'
|
elsif params[:normalize_phone] == 'true'
|
||||||
v.to_s.gsub(/[^0-9+]/, '')
|
v.to_s.gsub(/[^0-9+]/, '')
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user