Skip to content

Instantly share code, notes, and snippets.

@mnelson
Created November 9, 2011 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnelson/1351910 to your computer and use it in GitHub Desktop.
Save mnelson/1351910 to your computer and use it in GitHub Desktop.
class Effect < AR::Base
scope :my_scope, select('project_id, taskType, user_id, SUM(hours)').joins(:project_task).where(:project_tasks => {:project_id => 2, :taskType => 'Pre-Sales'}).group('user_id')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment