Skip to content

Commit

Permalink
normalize_automate_vals gets called with ActiveSupport::TimeWithZone,…
Browse files Browse the repository at this point in the history
… not string
  • Loading branch information
d-m-u committed Mar 5, 2019
1 parent 5307629 commit f136e9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/dialog_field_date_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def normalize_automate_values(automate_hash)

return default_time if automate_hash["value"].blank?
begin
return DateTime.parse(automate_hash["value"]).iso8601
return DateTime.parse(automate_hash["value"].to_s).iso8601
rescue
return default_time
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/dialog_field_date_control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

context "when the automate hash has a value" do
context "when the value is a date format" do
let(:value) { "01/02/2015" }
let(:value) { Time.utc(2015, 01, 02) }

it_behaves_like "DialogFieldDateControl#normalize_automate_values"

Expand Down

0 comments on commit f136e9d

Please sign in to comment.