milestones_routing_helper.rb 572 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
module MilestonesRoutingHelper
  def milestone_path(milestone, *args)
5
    if milestone.group_milestone?
6
      group_milestone_path(milestone.group, milestone, *args)
7
    elsif milestone.project_milestone?
8 9 10 11 12
      project_milestone_path(milestone.project, milestone, *args)
    end
  end

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