From 42a3c92c8c43a16185800e357bd95104288d761c Mon Sep 17 00:00:00 2001 From: fatkodima Date: Thu, 8 Feb 2018 16:13:15 +0200 Subject: Fix marshaling of models with `has_many :through` associations --- .../test/cases/associations/has_many_through_associations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases') 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..f465404694 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,12 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase Reader.create person_id: 0, post_id: 0 end + def test_marshal_dump + post = posts :welcome + preloaded = Post.includes(:first_blue_tags).find(post.id) + 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 -- cgit v1.2.3