From 9fcc0654c37772a3d6884c5d6f7099a39fe88f73 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 1 Jun 2006 00:43:02 +0000 Subject: Fixed that Base.find :all, :conditions => [ "id IN (?)", collection ] would fail if collection was empty [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4390 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 511af69428..4d878e6a1d 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1309,7 +1309,11 @@ module ActiveRecord #:nodoc: def quote_bound_value(value) #:nodoc: if (value.respond_to?(:map) && !value.is_a?(String)) - value.map { |v| connection.quote(v) }.join(',') + if value.empty? + "null" + else + value.map { |v| connection.quote(v) }.join(',') + end else connection.quote(value) end -- cgit v1.2.3