BigW Consortium Gitlab

milestones_routing_helper.rb 541 Bytes
Newer Older
1 2
module MilestonesRoutingHelper
  def milestone_path(milestone, *args)
3
    if milestone.group_milestone?
4
      group_milestone_path(milestone.group, milestone, *args)
5
    elsif milestone.project_milestone?
6 7 8 9 10
      project_milestone_path(milestone.project, milestone, *args)
    end
  end

  def milestone_url(milestone, *args)
11
    if milestone.group_milestone?
12
      group_milestone_url(milestone.group, milestone, *args)
13
    elsif milestone.project_milestone?
14 15 16 17
      project_milestone_url(milestone.project, milestone, *args)
    end
  end
end