aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2008-03-26 15:36:17 +0000
committerRick Olson <technoweenie@gmail.com>2008-03-26 15:36:17 +0000
commit1648208ab09277467220efc92a532994024eea78 (patch)
treee8f26e6b765abffc3250406efedc05b9b0981af3 /activerecord/test
parent628ffad98bcf4087ef16e899868d41bf22aa77d2 (diff)
downloadrails-1648208ab09277467220efc92a532994024eea78.tar.gz
rails-1648208ab09277467220efc92a532994024eea78.tar.bz2
rails-1648208ab09277467220efc92a532994024eea78.zip
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
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/cases/associations_test.rb7
1 files changed, 6 insertions, 1 deletions
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