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 Aug 2, 2012
1 parent c4b6b02 commit 57e14d9
Showing 1 changed file with 1 addition and 1 deletion.
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 57e14d9

Please sign in to comment.