diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-18 12:55:23 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-18 18:56:55 +0530 |
commit | 2a2bc8e84aa619089abcc4f9a4c2711a118e5fa9 (patch) | |
tree | 3ef933712b031887693528ae0657f2bf1448d56d /activerecord/test | |
parent | 8bb527464845071ee72bcbcddcf860d4af1eda32 (diff) | |
download | rails-2a2bc8e84aa619089abcc4f9a4c2711a118e5fa9.tar.gz rails-2a2bc8e84aa619089abcc4f9a4c2711a118e5fa9.tar.bz2 rails-2a2bc8e84aa619089abcc4f9a4c2711a118e5fa9.zip |
Handle invalid query IN() generated when a blank array is supplied in hash conditions
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index e31d0ee3e8..d34c9b4895 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -339,6 +339,11 @@ class RelationTest < ActiveRecord::TestCase assert_raises(ActiveRecord::RecordNotFound) { authors.find(['42', 43]) } end + def test_find_in_empty_array + authors = Author.scoped.where(:id => []) + assert authors.all.blank? + end + def test_exists davids = Author.where(:name => 'David') assert davids.exists? |