aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-05-29 10:20:39 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-29 10:20:39 +0100
commitabb1bd2efa43b8efbb3faf4ccfb9246704a9044c (patch)
tree197406a437a6f16de276979f983e499e4a448bf7 /activerecord/test/cases
parent4d248543429918bc5a63e109e6f2327ffab9848b (diff)
downloadrails-abb1bd2efa43b8efbb3faf4ccfb9246704a9044c.tar.gz
rails-abb1bd2efa43b8efbb3faf4ccfb9246704a9044c.tar.bz2
rails-abb1bd2efa43b8efbb3faf4ccfb9246704a9044c.zip
Ensure AssociationCollection#count works with empty condition. [#271 state:resolved] [Jan De Poorter]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 53b55022eb..cbc621b411 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -32,6 +32,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal 2, Firm.find(:first).plain_clients.count
end
+ def test_counting_with_empty_hash_conditions
+ assert_equal 2, Firm.find(:first).plain_clients.count(:conditions => {})
+ end
+
def test_counting_with_single_conditions
assert_equal 2, Firm.find(:first).plain_clients.count(:conditions => '1=1')
end