>
>  def total_cost
>    line_items.paid.sum(&:cost)
>  end
> end
>

Why would you calculate the sum in-memory instead of the database? So that
you can stub it?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en.

Reply via email to