Skip to content
This repository
Browse code

Merge pull request #6804 from acapilleri/firm_changes_from_zero_to_st…

…ring

changed the firm of changes_from_zero_to_string?
  • Loading branch information...
commit e76ced062078e1aeffcb963d28f144fe5e169139 2 parents 682d247 + c3a5be0
Carlos Antonio da Silva authored June 21, 2012
4  activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -78,7 +78,7 @@ def update(*)
78 78
       def _field_changed?(attr, old, value)
79 79
         if column = column_for_attribute(attr)
80 80
           if column.number? && (changes_from_nil_to_empty_string?(column, old, value) ||
81  
-                                changes_from_zero_to_string?(column, old, value))
  81
+                                changes_from_zero_to_string?(old, value))
82 82
             value = nil
83 83
           else
84 84
             value = column.type_cast(value)
@@ -96,7 +96,7 @@ def changes_from_nil_to_empty_string?(column, old, value)
96 96
         column.null && (old.nil? || old == 0) && value.blank?
97 97
       end
98 98
 
99  
-      def changes_from_zero_to_string?(column, old, value)
  99
+      def changes_from_zero_to_string?(old, value)
100 100
         # For columns with old 0 and value non-empty string
101 101
         old == 0 && value.present? && value != '0'
102 102
       end

0 notes on commit e76ced0

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