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.rb

30 lines
773 B

require "set"
module CostQuery::GroupBy
def self.all
@all ||= Set[
CostQuery::GroupBy::ActivityId,
CostQuery::GroupBy::CostObjectId,
CostQuery::GroupBy::CostTypeId,
CostQuery::GroupBy::FixedVersionId,
CostQuery::GroupBy::IssueId,
CostQuery::GroupBy::PriorityId,
CostQuery::GroupBy::ProjectId,
CostQuery::GroupBy::SpentOn,
CostQuery::GroupBy::Tmonth,
CostQuery::GroupBy::TrackerId,
#CostQuery::GroupBy::Tweek,
CostQuery::GroupBy::Tyear,
CostQuery::GroupBy::UserId,
CostQuery::GroupBy::Week
]
end
def self.all_grouped
all.group_by { |g| g.applies_for }.to_a.sort { |a,b| a.first.to_s <=> b.first.to_s }
end
def self.from_hash
raise NotImplementedError
end
end