add number field type

This commit is contained in:
Pete Matsyburka
2024-02-23 15:58:49 +02:00
parent b83abc9499
commit 03db636d51
10 changed files with 138 additions and 10 deletions
+2
View File
@@ -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