Commit ac3e5a58 authored by Maxim Rydkin's avatar Maxim Rydkin

replace `is_project_milestone?` with `project_milestone?`

parent 87467127
......@@ -2,7 +2,7 @@ module MilestonesRoutingHelper
def milestone_path(milestone, *args)
if milestone.is_group_milestone?
group_milestone_path(milestone.group, milestone, *args)
elsif milestone.is_project_milestone?
elsif milestone.project_milestone?
project_milestone_path(milestone.project, milestone, *args)
end
end
......@@ -10,7 +10,7 @@ module MilestonesRoutingHelper
def milestone_url(milestone, *args)
if milestone.is_group_milestone?
group_milestone_url(milestone.group, milestone, *args)
elsif milestone.is_project_milestone?
elsif milestone.project_milestone?
project_milestone_url(milestone.project, milestone, *args)
end
end
......
......@@ -74,7 +74,7 @@ module Milestoneish
false
end
def is_project_milestone?
def project_milestone?
false
end
......
......@@ -211,7 +211,7 @@ class Milestone < ActiveRecord::Base
group_id.present?
end
def is_project_milestone?
def project_milestone?
project_id.present?
end
......
module Milestones
class CloseService < Milestones::BaseService
def execute(milestone)
if milestone.close && milestone.is_project_milestone?
if milestone.close && milestone.project_milestone?
event_service.close_milestone(milestone, current_user)
end
......
......@@ -3,7 +3,7 @@ module Milestones
def execute
milestone = parent.milestones.new(params)
if milestone.save && milestone.is_project_milestone?
if milestone.save && milestone.project_milestone?
event_service.open_milestone(milestone, current_user)
end
......
module Milestones
class DestroyService < Milestones::BaseService
def execute(milestone)
return unless milestone.is_project_milestone?
return unless milestone.project_milestone?
Milestone.transaction do
update_params = { milestone: nil }
......
module Milestones
class ReopenService < Milestones::BaseService
def execute(milestone)
if milestone.activate && milestone.is_project_milestone?
if milestone.activate && milestone.project_milestone?
event_service.reopen_milestone(milestone, current_user)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment