diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-12-16 22:20:42 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-12-16 22:25:09 +0100 |
commit | 40b15f9f389b9394b22cf36567269e54c66c9fc8 (patch) | |
tree | 4d4639208f85d3f32933e13744b6c481671fda18 /activerecord/test | |
parent | e89fff2f6b815529cf729fc8e900a8275c9514e8 (diff) | |
download | rails-40b15f9f389b9394b22cf36567269e54c66c9fc8.tar.gz rails-40b15f9f389b9394b22cf36567269e54c66c9fc8.tar.bz2 rails-40b15f9f389b9394b22cf36567269e54c66c9fc8.zip |
ActiveRecord::Base.joins should allow single nil argument [#6181 state:resolved]
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 0b106e3bcd..20bfafbc5e 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -184,6 +184,10 @@ class RelationTest < ActiveRecord::TestCase 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 |