Dudebot wrote: > Thanks--I tried a bunch of different incarnations using sum() without > luck, and as I was starting to write raw SQL, I decided it would be > easier to read/more maintainable code just to use Ruby.
You got it backwards. In this case, doing the calculation on the DB side will be more maintainable. > The db is > small, and performance degradation should not be an issue. I wonder. What you're doing now sends lots of unnecessary data from the DB to the app. Doing it on the DB side will avoid this problem. I don't see a single good reason for doing the calculation in Ruby in this case. > > On Sep 28, 8:23�am, Marnen Laibow-Koser <rails-mailing-l...@andreas- Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

