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 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). -- Coda Hale http://blog.codahale.com
This patch fixes the errors I was getting. On 6/24/06, Coda Hale <coda.hale@gmail.com> wrote:> 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). > > -- > Coda Hale > http://blog.codahale.com > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >