diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-29 11:49:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-29 11:49:23 -0700 |
commit | 44046d0782be0737ec68964695a63a56727d17e1 (patch) | |
tree | a0aa3fc50d493efbd2f0bc775514425d0137a5b2 /activerecord/test/cases/associations | |
parent | 0b3a078a24819fae8b9df0b0f63a264cece70a7c (diff) | |
download | rails-44046d0782be0737ec68964695a63a56727d17e1.tar.gz rails-44046d0782be0737ec68964695a63a56727d17e1.tar.bz2 rails-44046d0782be0737ec68964695a63a56727d17e1.zip |
pk should not be required for hm:t associations
Diffstat (limited to 'activerecord/test/cases/associations')
-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 941e851aae..788177ee15 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -36,6 +36,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase Reader.create :person_id => 0, :post_id => 0 end + def test_pk_is_not_required_for_join + post = Post.includes(:scategories).first + post2 = Post.includes(:categories).first + + assert_equal post2.categories, post.categories + end + def test_include? person = Person.new post = Post.new |