From 1648208ab09277467220efc92a532994024eea78 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 26 Mar 2008 15:36:17 +0000 Subject: Fix duplicate table alias error when including an association with a has_many :through association on the same join table. Closes #7310 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9095 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/cases/associations_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activerecord/test/cases/associations_test.rb') diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 48c618b2c1..602fc18ab7 100755 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -551,7 +551,8 @@ end class HasManyAssociationsTest < ActiveRecord::TestCase fixtures :accounts, :companies, :developers, :projects, - :developers_projects, :topics, :authors, :comments, :author_addresses + :developers_projects, :topics, :authors, :comments, :author_addresses, + :people, :posts def setup Client.destroyed_client_ids.clear @@ -1318,6 +1319,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal 4, authors(:david).limited_comments.find(:all, :conditions => "comments.type = 'SpecialComment'", :limit => 9_000).length assert_equal 4, authors(:david).limited_comments.find_all_by_type('SpecialComment', :limit => 9_000).length end + + def test_find_all_include_over_the_same_table_for_through + assert_equal 2, people(:michael).posts.find(:all, :include => :people).length + end end -- cgit v1.2.3