Monkey patching TaskList::Item is no longer required. #2296

This commit is contained in:
Rubén Dávila 2015-11-20 10:49:12 -05:00
parent fc18e96db3
commit fa9f2dec0e
3 changed files with 4 additions and 13 deletions

View File

@ -7,6 +7,8 @@ require 'task_list/filter'
#
# Used by MergeRequest and Issue
module Taskable
COMPLETED = 'completed'.freeze
INCOMPLETE = 'incomplete'.freeze
ITEM_PATTERN = /
^
(?:\s*[-+*]|(?:\d+\.))? # optional list prefix

View File

@ -355,7 +355,8 @@ class SystemNoteService
#
# Returns the created Note object
def self.change_task_status(noteable, project, author, new_task)
body = "Marked the task **#{new_task.source}** as #{new_task.status_label}"
status_label = new_task.complete? ? Taskable::COMPLETED : Taskable::INCOMPLETE
body = "Marked the task **#{new_task.source}** as #{status_label}"
create_note(noteable: noteable, project: project, author: author, note: body)
end
end

View File

@ -1,12 +0,0 @@
require 'task_list'
class TaskList
class Item
COMPLETED = 'completed'.freeze
INCOMPLETE = 'incomplete'.freeze
def status_label
complete? ? COMPLETED : INCOMPLETE
end
end
end