Skip to content
Browse files

changed the firm of changes_from_zero_to_string?

delete *column* because is unused by the method.
  • Loading branch information...
1 parent 26a4e5e commit c3a5be012955a19d4bf52fd1589c373955b1a2cd @acapilleri acapilleri committed Jun 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/attribute_methods/dirty.rb
View
4 activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -78,7 +78,7 @@ def update(*)
def _field_changed?(attr, old, value)
if column = column_for_attribute(attr)
if column.number? && (changes_from_nil_to_empty_string?(column, old, value) ||
- changes_from_zero_to_string?(column, old, value))
+ changes_from_zero_to_string?(old, value))
value = nil
else
value = column.type_cast(value)
@@ -96,7 +96,7 @@ def changes_from_nil_to_empty_string?(column, old, value)
column.null && (old.nil? || old == 0) && value.blank?
end
- def changes_from_zero_to_string?(column, old, value)
+ def changes_from_zero_to_string?(old, value)
# For columns with old 0 and value non-empty string
old == 0 && value.present? && value != '0'
end

0 comments on commit c3a5be0

Please sign in to comment.
Something went wrong with that request. Please try again.