Permalink
Browse files

Add a test for outer joins with conditions where value IS NULL

  • Loading branch information...
1 parent 8d270a2 commit 9b7cd75db340b6d0c6f2ec342ae4d7a201e46e84 @ernie ernie committed May 5, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 activerecord/test/cases/associations/inner_join_association_test.rb
@@ -40,6 +40,11 @@ def test_join_conditions_added_to_join_clause
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"

0 comments on commit 9b7cd75

Please sign in to comment.