From 2a2bc8e84aa619089abcc4f9a4c2711a118e5fa9 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Mon, 18 Jan 2010 12:55:23 +0530 Subject: Handle invalid query IN() generated when a blank array is supplied in hash conditions --- activerecord/test/cases/relations_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test') 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? -- cgit v1.2.3