OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/models/cost_query/group_by/sql_aggregation.rb

20 lines
458 B

module CostQuery::GroupBy
module SqlAggregation
def responsible_for_sql?
true
end
def compute_result
super.tap { |r| r.important_fields = group_fields }.grouped_by(all_group_fields(false), type, group_fields)
end
def sql_statement
super.tap do |sql|
define_group sql
sql.sum :units => :units, :real_costs => :real_costs, :display_costs => :display_costs
sql.count
end
end
end
end