diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-06-25 17:49:24 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-06-25 17:49:24 +0000 |
commit | d9125093e8caaf112312d6e59052c3f20725fad2 (patch) | |
tree | 81e92033f131c4fb6cd8e4e1047473b7f4a932d5 /activerecord/test | |
parent | 99d268c8534ad398c6c60a4978ef94699cbb8ada (diff) | |
download | rails-d9125093e8caaf112312d6e59052c3f20725fad2.tar.gz rails-d9125093e8caaf112312d6e59052c3f20725fad2.tar.bz2 rails-d9125093e8caaf112312d6e59052c3f20725fad2.zip |
Add AssociationCollection#sum since the method_missing invokation has been shadowed by Enumerable#sum. Closes #5500.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/calculations_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/calculations_test.rb b/activerecord/test/calculations_test.rb index 67de1b9bd5..7b89e8c62c 100644 --- a/activerecord/test/calculations_test.rb +++ b/activerecord/test/calculations_test.rb @@ -147,6 +147,10 @@ class CalculationsTest < Test::Unit::TestCase assert_equal 3, c['CLIENT'] assert_equal 2, c['FIRM'] end + + def test_should_not_overshadow_enumerable_sum + assert_equal 6, [1, 2, 3].sum(&:abs) + end def test_should_sum_scoped_field assert_equal 15, companies(:rails_core).companies.sum(:id) |