Project

General

Profile

Counting custom field values

Added by Riho Maisa over 7 years ago

Hi,

I am trying to count custom field values. I can get (for testing):

 Issue.visible.joins(:status, :project).where(statement).sum(:estimated_hours)

But what would be the right way to count instead custom field id=2 values?

Similar to: .sum(:custom_field_values(2)) (but this doesn't work of course)