diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-02-09 09:47:16 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-02-09 09:53:35 +0900 |
commit | 52c9af6c51fbf686762ad2330f36fe9f8ce3c5d7 (patch) | |
tree | bc79aa09af37cda16be31d02c90d3a41aebcaab5 /activerecord/lib | |
parent | 0613533f78763be88337187951ab7d76106ace53 (diff) | |
parent | 42a3c92c8c43a16185800e357bd95104288d761c (diff) | |
download | rails-52c9af6c51fbf686762ad2330f36fe9f8ce3c5d7.tar.gz rails-52c9af6c51fbf686762ad2330f36fe9f8ce3c5d7.tar.bz2 rails-52c9af6c51fbf686762ad2330f36fe9f8ce3c5d7.zip |
Merge pull request #31934 from fatkodima/fix-has_many_through-dumping
Fix marshaling of models with `has_many :through` associations
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 7667c6ed8b..364f1fe74f 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -156,9 +156,9 @@ module ActiveRecord reset end - # We can't dump @reflection since it contains the scope proc + # We can't dump @reflection and @through_reflection since it contains the scope proc def marshal_dump - ivars = (instance_variables - [:@reflection]).map { |name| [name, instance_variable_get(name)] } + ivars = (instance_variables - [:@reflection, :@through_reflection]).map { |name| [name, instance_variable_get(name)] } [@reflection.name, ivars] end |