diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 11:01:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 11:01:59 -0700 |
commit | 850b3ca4779da201d4805a12fe29d9d9a491739e (patch) | |
tree | 438cede35a48ba1be74f4322d8df01a22416592f /activerecord/test | |
parent | 66a18855eafa71c11a37333ce1314889cbd0f742 (diff) | |
download | rails-850b3ca4779da201d4805a12fe29d9d9a491739e.tar.gz rails-850b3ca4779da201d4805a12fe29d9d9a491739e.tar.bz2 rails-850b3ca4779da201d4805a12fe29d9d9a491739e.zip |
supporting nil when passed in as an IN clause
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 9b6363902e..be4ba18555 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -1045,7 +1045,7 @@ class FinderTest < ActiveRecord::TestCase :order => ' author_addresses_authors.id DESC ', :limit => 3).size end - def test_find_with_nil_inside_set_passed_for_attribute + def test_find_with_nil_inside_set_passed_for_one_attribute client_of = Company.find( :all, :conditions => { @@ -1054,7 +1054,8 @@ class FinderTest < ActiveRecord::TestCase :order => 'client_of DESC' ).map { |x| x.client_of } - assert_equal [2, 1, nil], client_of + assert client_of.include?(nil) + assert_equal [2, 1].sort, client_of.compact.sort end def test_find_with_nil_inside_set_passed_for_attribute @@ -1064,7 +1065,7 @@ class FinderTest < ActiveRecord::TestCase :order => 'client_of DESC' ).map { |x| x.client_of } - assert_equal [nil], client_of + assert_equal [], client_of.compact end def test_with_limiting_with_custom_select |