Skip to content

Commit

Permalink
Address test_integer_zero_to_integer_zero_not_marked_as_changed failure
Browse files Browse the repository at this point in the history
See rails issue #7237.
  • Loading branch information
yahonda committed Nov 13, 2012
1 parent 9b65f00 commit 8d838f4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _field_changed?(attr, old, value)
# therefore need to convert empty string value to nil if old value is nil
elsif column.type == :string && column.null && old.nil?
value = nil if value == ''
elsif old == 0 && value.present? && value != '0'
elsif old == 0 && value.is_a?(String) && value.present? && value != '0'
value = nil
else
value = column.type_cast(value)
Expand Down

0 comments on commit 8d838f4

Please sign in to comment.