make sql aggregation inherit from its Report correspondent

pull/6827/head
jwollert 14 years ago
parent b90295d7d5
commit 4837546c28
  1. 10
      app/models/cost_query/group_by/sql_aggregation.rb

@ -1,18 +1,10 @@
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
include Report::GroupBy::SqlAggregation
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

Loading…
Cancel
Save