diff options
author | Rubén Dávila <ruben@gitlab.com> | 2015-11-20 10:49:12 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2015-11-20 10:49:12 -0500 |
commit | fa9f2dec0e07ff3ae3a2acd6ee0586e317bdb7b6 (patch) | |
tree | df50951dd8963d6a8cd42e9e46f1c5e13e7d5bd6 | |
parent | fc18e96db38f5d5ab5e102fe630682f6779203ba (diff) | |
download | gitlab-ce-fa9f2dec0e07ff3ae3a2acd6ee0586e317bdb7b6.tar.gz |
Monkey patching TaskList::Item is no longer required. #2296
-rw-r--r-- | app/models/concerns/taskable.rb | 2 | ||||
-rw-r--r-- | app/services/system_note_service.rb | 3 | ||||
-rw-r--r-- | config/initializers/task_list_ext.rb | 12 |
3 files changed, 4 insertions, 13 deletions
diff --git a/app/models/concerns/taskable.rb b/app/models/concerns/taskable.rb index 3daa4dbe24e..de7588fea86 100644 --- a/app/models/concerns/taskable.rb +++ b/app/models/concerns/taskable.rb @@ -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 diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 7c5d523ef39..7e2bc834176 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -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 diff --git a/config/initializers/task_list_ext.rb b/config/initializers/task_list_ext.rb deleted file mode 100644 index c05b683b5be..00000000000 --- a/config/initializers/task_list_ext.rb +++ /dev/null @@ -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 |