aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-02-09 09:47:16 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-02-09 09:53:35 +0900
commit52c9af6c51fbf686762ad2330f36fe9f8ce3c5d7 (patch)
treebc79aa09af37cda16be31d02c90d3a41aebcaab5 /activerecord/test
parent0613533f78763be88337187951ab7d76106ace53 (diff)
parent42a3c92c8c43a16185800e357bd95104288d761c (diff)
downloadrails-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/test')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 25118b26f5..3b3d4037b9 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -46,6 +46,11 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
Reader.create person_id: 0, post_id: 0
end
+ def test_marshal_dump
+ preloaded = Post.includes(:first_blue_tags).first
+ assert_equal preloaded, Marshal.load(Marshal.dump(preloaded))
+ end
+
def test_preload_sti_rhs_class
developers = Developer.includes(:firms).all.to_a
assert_no_queries do