From 0cbdd96c349c56c47299ca3c2bfa5d8c4f5e5a11 Mon Sep 17 00:00:00 2001 From: Jonathan Viney Date: Sun, 11 May 2008 21:01:18 +0100 Subject: Fix blank conditions on AssociationCollection#find. [#104 state:resolved] Signed-off-by: Pratik Naik --- .../test/cases/associations/has_many_associations_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 7b97afe42c..9e26e2ad58 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -48,6 +48,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal 2, Firm.find(:first).clients.length end + def test_find_with_blank_conditions + [[], {}, nil, ""].each do |blank| + assert_equal 2, Firm.find(:first).clients.find(:all, :conditions => blank).size + end + end + def test_find_many_with_merged_options assert_equal 1, companies(:first_firm).limited_clients.size assert_equal 1, companies(:first_firm).limited_clients.find(:all).size @@ -851,4 +857,4 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert ! firm.clients.include?(client) end -end \ No newline at end of file +end -- cgit v1.2.3