diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-06-27 10:14:57 +0200 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-06-30 09:45:16 +0200 |
commit | c223fb1a9677ae00285426090618f5762de9f40e (patch) | |
tree | b09d63edbd4982066daf2f25203e12b8e0655b3a /app/services/milestones | |
parent | b6425f33bc0b0547058e96e5ab99a7892d9297f2 (diff) | |
download | gitlab-ce-c223fb1a9677ae00285426090618f5762de9f40e.tar.gz |
Start building group milestone show page.
Diffstat (limited to 'app/services/milestones')
-rw-r--r-- | app/services/milestones/group_service.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/services/milestones/group_service.rb b/app/services/milestones/group_service.rb index 39ae913a72a..2d1aa878c24 100644 --- a/app/services/milestones/group_service.rb +++ b/app/services/milestones/group_service.rb @@ -5,16 +5,22 @@ module Milestones end def execute - @project_milestones.map{ |title, milestone| GroupMilestone.new(title, milestone) } + build(@project_milestones) end def milestone(title) if title - @project_milestones[title] + group_milestone = @project_milestones[title].group_by(&:title) + build(group_milestone).first else nil end end + private + + def build(milestone) + milestone.map{ |title, milestones| GroupMilestone.new(title, milestones) } + end end end |