summaryrefslogtreecommitdiff
path: root/app/helpers/milestones_routing_helper.rb
blob: a49b561533a63dc5fc3c5348902de2d5568ddc05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module MilestonesRoutingHelper
  def milestone_path(milestone, *args)
    if milestone.group_milestone?
      group_milestone_path(milestone.group, milestone, *args)
    elsif milestone.project_milestone?
      project_milestone_path(milestone.project, milestone, *args)
    end
  end

  def milestone_url(milestone, *args)
    if milestone.group_milestone?
      group_milestone_url(milestone.group, milestone, *args)
    elsif milestone.project_milestone?
      project_milestone_url(milestone.project, milestone, *args)
    end
  end
end