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 ...@@ -2,7 +2,7 @@ module MilestonesRoutingHelper
def milestone_path(milestone, *args) def milestone_path(milestone, *args)
if milestone.is_group_milestone? if milestone.is_group_milestone?
group_milestone_path(milestone.group, milestone, *args) group_milestone_path(milestone.group, milestone, *args)
elsif milestone.is_project_milestone? elsif milestone.project_milestone?
project_milestone_path(milestone.project, milestone, *args) project_milestone_path(milestone.project, milestone, *args)
end end
end end
...@@ -10,7 +10,7 @@ module MilestonesRoutingHelper ...@@ -10,7 +10,7 @@ module MilestonesRoutingHelper
def milestone_url(milestone, *args) def milestone_url(milestone, *args)
if milestone.is_group_milestone? if milestone.is_group_milestone?
group_milestone_url(milestone.group, milestone, *args) group_milestone_url(milestone.group, milestone, *args)
elsif milestone.is_project_milestone? elsif milestone.project_milestone?
project_milestone_url(milestone.project, milestone, *args) project_milestone_url(milestone.project, milestone, *args)
end end
end end
......
...@@ -74,7 +74,7 @@ module Milestoneish ...@@ -74,7 +74,7 @@ module Milestoneish
false false
end end
def is_project_milestone? def project_milestone?
false false
end end
......
...@@ -211,7 +211,7 @@ class Milestone < ActiveRecord::Base ...@@ -211,7 +211,7 @@ class Milestone < ActiveRecord::Base
group_id.present? group_id.present?
end end
def is_project_milestone? def project_milestone?
project_id.present? project_id.present?
end end
......
module Milestones module Milestones
class CloseService < Milestones::BaseService class CloseService < Milestones::BaseService
def execute(milestone) def execute(milestone)
if milestone.close && milestone.is_project_milestone? if milestone.close && milestone.project_milestone?
event_service.close_milestone(milestone, current_user) event_service.close_milestone(milestone, current_user)
end end
......
...@@ -3,7 +3,7 @@ module Milestones ...@@ -3,7 +3,7 @@ module Milestones
def execute def execute
milestone = parent.milestones.new(params) 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) event_service.open_milestone(milestone, current_user)
end end
......
module Milestones module Milestones
class DestroyService < Milestones::BaseService class DestroyService < Milestones::BaseService
def execute(milestone) def execute(milestone)
return unless milestone.is_project_milestone? return unless milestone.project_milestone?
Milestone.transaction do Milestone.transaction do
update_params = { milestone: nil } update_params = { milestone: nil }
......
module Milestones module Milestones
class ReopenService < Milestones::BaseService class ReopenService < Milestones::BaseService
def execute(milestone) def execute(milestone)
if milestone.activate && milestone.is_project_milestone? if milestone.activate && milestone.project_milestone?
event_service.reopen_milestone(milestone, current_user) event_service.reopen_milestone(milestone, current_user)
end 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