Am Freitag, 26. Oktober 2012 16:53:13 UTC+2 schrieb Rob Biedenharn:
> On Oct 26, 2012, at 8:18 AM, Werner wrote:
> > 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.
> > I cant find anything ...some help would be great.
> You left the argument out of the .sum (i..e, .sum('hour') on the second
> I think that you just need this:
> Week.where(project_id: @project_id).sum('hour')
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.