From 9b9357b26eb24a55cfdcfca25bcaede72bd7902e Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 4 Mar 2012 11:43:16 -0300 Subject: 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. --- activerecord/lib/active_record/associations/association.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/associations') 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 -- cgit v1.2.3