aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2016-11-03 10:59:25 +0000
committerAndrew White <andrew.white@unboxed.co>2016-11-03 10:59:25 +0000
commitccbeea0a77df995e62e59289e89aeb242fcf742c (patch)
tree240b610928fffb394421fe8e5d744465f85314e0
parentddeabad059086ce76771962e71a9cdf24324db3d (diff)
downloadrails-ccbeea0a77df995e62e59289e89aeb242fcf742c.tar.gz
rails-ccbeea0a77df995e62e59289e89aeb242fcf742c.tar.bz2
rails-ccbeea0a77df995e62e59289e89aeb242fcf742c.zip
Fix uninitialized warning with @new_record instance variable
Initializing @stale_state to nil when an association is built fixes a marshalling error - see #5268 for more details.
-rw-r--r--activerecord/lib/active_record/associations/association.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb
index abee941c07..7cdaf78223 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