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/test/base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 094d533a22..70035d6b4e 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -933,10 +933,10 @@ class BasicsTest < Test::Unit::TestCase end def test_quoting_arrays - replies = Reply.find(:all, :conditions => [ "id IN (?)", topics(:first).replies.to_s(:db) ]) + replies = Reply.find(:all, :conditions => [ "id IN (?)", topics(:first).replies.collect(&:id) ]) assert_equal topics(:first).replies.size, replies.size - replies = Reply.find(:all, :conditions => [ "id IN (?)", [].to_s(:db) ]) + replies = Reply.find(:all, :conditions => [ "id IN (?)", [] ]) assert_equal 0, replies.size end -- cgit v1.2.3