From 44046d0782be0737ec68964695a63a56727d17e1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 29 Aug 2013 11:49:23 -0700 Subject: pk should not be required for hm:t associations --- .../test/cases/associations/has_many_through_associations_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb') 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 -- cgit v1.2.3