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)>