diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-18 13:42:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 13:42:57 -0400 |
commit | 36ff7b63ec083924a5b407cf3df7ae90e22183e2 (patch) | |
tree | 8cbdbe138f13a0dc7c3666f036fda685c644d262 /activerecord/test/cases/associations/has_many_through_associations_test.rb | |
parent | 425ba83c28214ca97c5d3600c16ad7a796cd33e6 (diff) | |
parent | f47bac481949a69a519ea7d833e1a8d435332d52 (diff) | |
download | rails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.tar.gz rails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.tar.bz2 rails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.zip |
Merge branch 'master' into fix_unscope_where_column_with_or
Diffstat (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 7 |
1 files changed, 7 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 1c2138a3d0..a76159fb99 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -946,6 +946,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end end + def test_has_many_through_polymorphic_with_rewhere + post = TaggedPost.create!(title: "Tagged", body: "Post") + tag = post.tags.create!(name: "Tag") + assert_equal [tag], TaggedPost.preload(:tags).last.tags + assert_equal [tag], TaggedPost.eager_load(:tags).last.tags + end + def test_has_many_through_polymorphic_with_primary_key_option assert_equal [categories(:general)], authors(:david).essay_categories |