Permalink
Browse files

ActiveRecord::Base.joins should allow single nil argument [#6181 stat…

…e:resolved]
  • Loading branch information...
1 parent e89fff2 commit 40b15f9f389b9394b22cf36567269e54c66c9fc8 @drogus drogus committed Dec 16, 2010
@@ -63,7 +63,7 @@ def order(*args)
end
def joins(*args)
- return self if args.blank?
+ return self if args.compact.blank?
relation = clone
@@ -184,6 +184,10 @@ def test_select_with_block
assert_equal [2, 4, 6, 8, 10], even_ids.sort
end
+ def test_joins_with_nil_argument
+ assert_nothing_raised { DependentFirm.joins(nil).first }
+ end
+
def test_finding_with_hash_conditions_on_joined_table
firms = DependentFirm.joins(:account).where({:name => 'RailsCore', :accounts => { :credit_limit => 55..60 }}).to_a
assert_equal 1, firms.size

0 comments on commit 40b15f9

Please sign in to comment.