Looks like some changes made in the Ennumerable extensions had some
majorly negative effects on the Summing ability of AR.
Sample Errors off mysql:
2) Error:
test_should_group_by_summed_field_with_conditions_and_having(CalculationsTest):
ArgumentError: wrong number of arguments (2 for 0)
./test/../lib/active_record/associations/association_proxy.rb:123:in
`sum'
./test/../lib/active_record/associations/association_proxy.rb:123:in
`method_missing'
./test/../lib/active_record/associations/has_many_association.rb:95:in
`method_missing'
./test/calculations_test.rb:166:in
`test_should_group_by_summed_field_with_conditions_and_having'
3) Error:
test_should_sum_scoped_field(CalculationsTest):
ArgumentError: wrong number of arguments (1 for 0)
./test/../lib/active_record/associations/association_proxy.rb:123:in
`sum'
./test/../lib/active_record/associations/association_proxy.rb:123:in
`method_missing'
./test/../lib/active_record/associations/has_many_association.rb:95:in
`method_missing'
./test/calculations_test.rb:152:in `test_should_sum_scoped_field'
Working on a way around this right now....
-hampton.
on 25.06.2006 01:07
on 25.06.2006 02:27
On 6/24/06, Hampton <hcatlin@gmail.com> wrote: > Looks like some changes made in the Ennumerable extensions had some > majorly negative effects on the Summing ability of AR. Enumerable#sum was overriding AR::Calculations#sum. I opened a ticket for this (#5500 [http://dev.rubyonrails.org/ticket/5500]) with a patch which manually routes #sum to #calculate in AssociationCollection. The unit tests all pass now (MySQL).