aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2008-08-28 14:01:42 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-28 11:58:25 -0700
commit44af2efa2c7391681968c827ca47201a0a02e974 (patch)
treea25ede2a88799c281468fcdaa4321d6048cee240 /activerecord/test
parentce4d13861dc54a1ac7fbe411327b9a2427f95366 (diff)
downloadrails-44af2efa2c7391681968c827ca47201a0a02e974.tar.gz
rails-44af2efa2c7391681968c827ca47201a0a02e974.tar.bz2
rails-44af2efa2c7391681968c827ca47201a0a02e974.zip
Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.
[#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
index 0572418e3b..1b31d28679 100644
--- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
@@ -703,4 +703,11 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
# due to Unknown column 'authors.id'
assert Category.find(1).posts_with_authors_sorted_by_author_id.find_by_title('Welcome to the weblog')
end
+
+ def test_counting_on_habtm_association_and_not_array
+ david = Developer.find(1)
+ # Extra parameter just to make sure we aren't falling back to
+ # Array#count in Ruby >=1.8.7, which would raise an ArgumentError
+ assert_nothing_raised { david.projects.count(:all, :conditions => '1=1') }
+ end
end