diff options
author | Ernie Miller <ernie@metautonomo.us> | 2011-05-05 12:35:29 -0400 |
---|---|---|
committer | Ernie Miller <ernie@metautonomo.us> | 2011-05-05 12:35:29 -0400 |
commit | 8d270a2abbc1601777f4918bd1968c18f7864ae5 (patch) | |
tree | afe26d262bd63b3ecf62fad368143d1c5c3c9ec0 /activerecord/test/cases | |
parent | ee898e5248d3876372c8303f500afe2baf6f298c (diff) | |
download | rails-8d270a2abbc1601777f4918bd1968c18f7864ae5.tar.gz rails-8d270a2abbc1601777f4918bd1968c18f7864ae5.tar.bz2 rails-8d270a2abbc1601777f4918bd1968c18f7864ae5.zip |
Add join conditions to JOIN clause, not WHERE
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/inner_join_association_test.rb | 6 |
1 files changed, 6 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 e2228228a3..cc19c874f0 100644 --- a/activerecord/test/cases/associations/inner_join_association_test.rb +++ b/activerecord/test/cases/associations/inner_join_association_test.rb @@ -34,6 +34,12 @@ class InnerJoinAssociationTest < ActiveRecord::TestCase assert_no_match(/JOIN/i, sql) end + def test_join_conditions_added_to_join_clause + sql = Author.joins(:essays).to_sql + assert_match(/writer_type.*?=.*?Author/i, sql) + assert_no_match(/WHERE/i, sql) + end + def test_find_with_implicit_inner_joins_honors_readonly_without_select authors = Author.joins(:posts).to_a assert !authors.empty?, "expected authors to be non-empty" |