gitlab-org--gitlab-foss/app/helpers/milestones_routing_helper.rb
Sean McGivern 149528f472 Support references to group milestones
Group milestones can only be referred to by name, not IID. They also do not
support cross-project references.
2017-08-07 11:55:00 +01:00

17 lines
553 B
Ruby

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