diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-04 11:43:16 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-04 11:46:30 -0300 |
commit | 9b9357b26eb24a55cfdcfca25bcaede72bd7902e (patch) | |
tree | f1fa92be7e5a6a1efe716e221d357868f980eac8 /activerecord/lib/active_record | |
parent | 9a2e164d733216b13dce7c766600b8b6ae9c9b12 (diff) | |
download | rails-9b9357b26eb24a55cfdcfca25bcaede72bd7902e.tar.gz rails-9b9357b26eb24a55cfdcfca25bcaede72bd7902e.tar.bz2 rails-9b9357b26eb24a55cfdcfca25bcaede72bd7902e.zip |
Initialize @stale_state to nil in association
This apparently fix the warning related to @new_record variable not
being initialized in AR's test suit, when an association is built and
the object is marshalled/loaded.
See these tests in AR's base_test.rb:
test_marshalling_with_associations
test_marshalling_new_record_round_trip_with_associations
Closes #3720.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/core.rb | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 7887d59aad..c971fbb393 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -28,6 +28,7 @@ module ActiveRecord @target = nil @owner, @reflection = owner, reflection @updated = false + @stale_state = nil reset reset_scope diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 3f90d25962..e75a2a1cb4 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -193,7 +193,6 @@ module ActiveRecord @attributes = self.class.initialize_attributes(coder['attributes']) @columns_hash = self.class.column_types.merge(coder['column_types'] || {}) - init_internals @new_record = false |