[Rails] Re: Re: Calculate methods on attr_accessor objects
François Montel
zerohalo at gmail.com
Thu Jul 27 19:41:32 GMT 2006
Ah of course, I figured there was a simple Rails way but hadn't found
it. Why didn't I try that? :-)
The kind of thing that would be handy to add to the documentation.
By the way, there used to be annotated documentation at
rails.outertrack.com but it's down these days. Has it moved elsewhere? I
could add a comment on this to it.
Rick Olson wrote:
>> Item.count_by_sql("select sum(cost_unit * amount) from items")
>
> Item.sum 'cost_unit * amount'
--
Posted via http://www.ruby-forum.com/.
More information about the Rails
mailing list