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

36 lines
1009 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::SingletonValue,
CostQuery::GroupBy::Tmonth,
CostQuery::GroupBy::TrackerId,
#CostQuery::GroupBy::Tweek,
CostQuery::GroupBy::Tyear,
CostQuery::GroupBy::UserId,
CostQuery::GroupBy::Week,
CostQuery::GroupBy::AuthorId,
CostQuery::GroupBy::AssignedToId,
CostQuery::GroupBy::CategoryId,
CostQuery::GroupBy::StatusId,
*CostQuery::GroupBy::CustomField.all
]
end
def self.all_grouped
all.group_by { |f| f.applies_for }.to_a.sort { |a,b| a.first.to_s <=> b.first.to_s }
end
def self.from_hash
raise NotImplementedError
end
end