aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/inner_join_association_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-20 18:34:43 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-20 18:34:43 -0700
commitb10fb7e7bcb5efea6c93ae52bad125887cfc235c (patch)
treebda34b186b63ac607e7387df935e4d67f3b5123b /activerecord/test/cases/associations/inner_join_association_test.rb
parent164a94d0bc8c9124ab820506e5ad79496395c026 (diff)
parentde0ea3866370ec61581f910cf393a3cc97eba32f (diff)
downloadrails-b10fb7e7bcb5efea6c93ae52bad125887cfc235c.tar.gz
rails-b10fb7e7bcb5efea6c93ae52bad125887cfc235c.tar.bz2
rails-b10fb7e7bcb5efea6c93ae52bad125887cfc235c.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'activerecord/test/cases/associations/inner_join_association_test.rb')
-rw-r--r--activerecord/test/cases/associations/inner_join_association_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/inner_join_association_test.rb b/activerecord/test/cases/associations/inner_join_association_test.rb
index f87c914125..7141531740 100644
--- a/activerecord/test/cases/associations/inner_join_association_test.rb
+++ b/activerecord/test/cases/associations/inner_join_association_test.rb
@@ -29,6 +29,11 @@ class InnerJoinAssociationTest < ActiveRecord::TestCase
assert_match /INNER JOIN .?categories.? ON.*AND.*.?General.?.*TERMINATING_MARKER/, sql
end
+ def test_construct_finder_sql_applies_aliases_tables_on_association_conditions
+ result = Author.find(:all, :joins => [:thinking_posts, :welcome_posts])
+ assert_equal authors(:david), result.first
+ end
+
def test_construct_finder_sql_unpacks_nested_joins
sql = Author.send(:construct_finder_sql, :joins => {:posts => [[:comments]]})
assert_no_match /inner join.*inner join.*inner join/i, sql, "only two join clauses should be present"