mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
add number field type
This commit is contained in:
1 parent
b83abc9499
commit
03db636d51
10 files changed
+138
-10
No files matched your search
@@ -51,6 +51,8 @@ module Submitters
|
||||
def normalize_value(field, value)
|
||||
if field['type'] == 'text' && value.present?
|
||||
value.to_s
|
||||
elsif field['type'] == 'number' && value.present?
|
||||
(value.to_f % 1).zero? ? value.to_i : value.to_f
|
||||
elsif field['type'] == 'date' && value.present?
|
||||
if value.is_a?(Integer)
|
||||
Time.zone.at(value.to_s.first(10).to_i).to_date
|
||||
|
||||
Reference in new issue
Block a user