aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/inner_join_association_test.rb
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2011-05-05 14:34:48 -0400
committerErnie Miller <ernie@metautonomo.us>2011-05-05 14:34:48 -0400
commit9b7cd75db340b6d0c6f2ec342ae4d7a201e46e84 (patch)
tree01160b9a6a880580cf59016ed271462e1a6eedb1 /activerecord/test/cases/associations/inner_join_association_test.rb
parent8d270a2abbc1601777f4918bd1968c18f7864ae5 (diff)
downloadrails-9b7cd75db340b6d0c6f2ec342ae4d7a201e46e84.tar.gz
rails-9b7cd75db340b6d0c6f2ec342ae4d7a201e46e84.tar.bz2
rails-9b7cd75db340b6d0c6f2ec342ae4d7a201e46e84.zip
Add a test for outer joins with conditions where value IS NULL
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 cc19c874f0..124693f7c9 100644
--- a/activerecord/test/cases/associations/inner_join_association_test.rb
+++ b/activerecord/test/cases/associations/inner_join_association_test.rb
@@ -40,6 +40,11 @@ class InnerJoinAssociationTest < ActiveRecord::TestCase
assert_no_match(/WHERE/i, sql)
end
+ def test_join_conditions_allow_nil_associations
+ authors = Author.includes(:essays).where(:essays => {:id => nil})
+ assert_equal 2, authors.count
+ 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"