diff options
author | fatkodima <fatkodima123@gmail.com> | 2018-02-08 16:13:15 +0200 |
---|---|---|
committer | fatkodima <fatkodima123@gmail.com> | 2018-02-08 16:13:56 +0200 |
commit | 42a3c92c8c43a16185800e357bd95104288d761c (patch) | |
tree | a63a12bdf7b37291eb6153d1db3641f3382a2839 /activerecord/test/cases/associations | |
parent | d7f9adf7941574d0a40a165739938d28f278bd77 (diff) | |
download | rails-42a3c92c8c43a16185800e357bd95104288d761c.tar.gz rails-42a3c92c8c43a16185800e357bd95104288d761c.tar.bz2 rails-42a3c92c8c43a16185800e357bd95104288d761c.zip |
Fix marshaling of models with `has_many :through` associations
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 6 |
1 files changed, 6 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..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 |