aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorNat Budin <nbudin@patientslikeme.com>2014-06-17 10:11:22 -0700
committerNat Budin <nbudin@patientslikeme.com>2014-06-17 10:15:04 -0700
commit30b76e5575c57056361741ebbede972f8ef477de (patch)
treeb6c0b24bc6e1242ca8170f46c8223d1537171ebd /activerecord/test/cases
parent0c2fbc509545612908dd7bbdde3221518a2ec0e1 (diff)
downloadrails-30b76e5575c57056361741ebbede972f8ef477de.tar.gz
rails-30b76e5575c57056361741ebbede972f8ef477de.tar.bz2
rails-30b76e5575c57056361741ebbede972f8ef477de.zip
Don't include inheritance column in the through_scope_attributes
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb8
1 files changed, 8 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 8641584c0c..ad2aa99af5 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -1139,4 +1139,12 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal 2, post.lazy_readers_unscope_skimmers.to_a.size
assert_equal 2, post.lazy_people_unscope_skimmers.to_a.size
end
+
+ def test_has_many_through_add_with_sti_middle_relation
+ club = SuperClub.create!(name: 'Fight Club')
+ member = Member.create!(name: 'Tyler Durden')
+
+ club.members << member
+ assert_equal 1, SuperMembership.where(member_id: member.id, club_id: club.id).count
+ end
end