I have a column "hours" which I want to sum up the decimals

Week.sum('hour')    => 22.5

But I want to "select by project_id" not the hole table.
Week.find_all_by_project_id(@project.id, :select => "workhour").sum  
#undefined method `+' for #<Week hour: 
#<BigDecimal:7fd68b358400,'0.0',9(18)>>

I cant find anything ...some help would be great.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/wxu_phRAvMQJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to