Permalink
Browse files

Merge pull request #190 from yahonda/field_changed_rails4

rails4: Address 2 failures at nested_attributes_test.rb
  • Loading branch information...
yahonda committed Jun 21, 2012
2 parents 02b2c93 + e354c82 commit affd18c6ef018353f1862c1ed319e236d2a0a95d
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/active_record/connection_adapters/oracle_enhanced_dirty.rb
@@ -18,6 +18,8 @@ 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'
+ value = nil
else
value = column.type_cast(value)
end

0 comments on commit affd18c

Please sign in to comment.