Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 carlosantoniodasilva authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/attribute_methods/dirty.rb
4 activerecord/lib/active_record/attribute_methods/dirty.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.