diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 495f0cde59..ba75c8be41 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -154,11 +154,8 @@ module ActiveRecord # We can't dump @reflection since it contains the scope proc def marshal_dump - reflection = @reflection - @reflection = nil - - ivars = instance_variables.map { |name| [name, instance_variable_get(name)] } - [reflection.name, ivars] + ivars = (instance_variables - [:@reflection]).map { |name| [name, instance_variable_get(name)] } + [@reflection.name, ivars] end def marshal_load(data) |