diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-03 14:50:06 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-07 13:55:00 +0300 |
commit | 149528f472f3d2f3865ae01c764b81c6a97f9380 (patch) | |
tree | 8c9e38e7071b0a0002d3741259a7318e7a0427e5 /app/helpers/milestones_routing_helper.rb | |
parent | 03b816f3e845c9b25d3588336fc1616238465deb (diff) |
Support references to group milestones
Group milestones can only be referred to by name, not IID. They also do not
support cross-project references.
Diffstat (limited to 'app/helpers/milestones_routing_helper.rb')
-rw-r--r-- | app/helpers/milestones_routing_helper.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/milestones_routing_helper.rb b/app/helpers/milestones_routing_helper.rb new file mode 100644 index 00000000000..766d5262018 --- /dev/null +++ b/app/helpers/milestones_routing_helper.rb @@ -0,0 +1,17 @@ +module MilestonesRoutingHelper + def milestone_path(milestone, *args) + if milestone.is_group_milestone? + group_milestone_path(milestone.group, milestone, *args) + elsif milestone.is_project_milestone? + project_milestone_path(milestone.project, milestone, *args) + end + end + + def milestone_url(milestone, *args) + if milestone.is_group_milestone? + group_milestone_url(milestone.group, milestone, *args) + elsif milestone.is_project_milestone? + project_milestone_url(milestone.project, milestone, *args) + end + end +end |