diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-02 08:14:43 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-02 08:14:43 -0400 |
commit | 1a693c79c32cba070256fdb7bd1990c3d07d554f (patch) | |
tree | 75f5b6459c1cdc7510469f28be5f6a6c000fe046 /activerecord/lib/active_record/attribute_methods | |
parent | 07723c23a7dc570beae73c074ad37227e3e8a06e (diff) | |
download | rails-1a693c79c32cba070256fdb7bd1990c3d07d554f.tar.gz rails-1a693c79c32cba070256fdb7bd1990c3d07d554f.tar.bz2 rails-1a693c79c32cba070256fdb7bd1990c3d07d554f.zip |
Fix test failures on MySQL
There were a few places where I missed a `create` vs `new`
before_type_cast check, and the semantics of `reload` became wrong.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index a2e4e0ac31..17ec4c2252 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -35,7 +35,9 @@ module ActiveRecord # <tt>reload</tt> the record and clears changed attributes. def reload(*) super.tap do - clear_changes_information + @mutation_tracker = AttributeMutationTracker.new(@attributes) + @previous_mutation_tracker = nil + @changed_attributes = HashWithIndifferentAccess.new end end |