From fa9f2dec0e07ff3ae3a2acd6ee0586e317bdb7b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rub=C3=A9n=20D=C3=A1vila?= <ruben@gitlab.com>
Date: Fri, 20 Nov 2015 10:49:12 -0500
Subject: [PATCH] Monkey patching TaskList::Item is no longer required. #2296

---
 app/models/concerns/taskable.rb      |  2 ++
 app/services/system_note_service.rb  |  3 ++-
 config/initializers/task_list_ext.rb | 12 ------------
 3 files changed, 4 insertions(+), 13 deletions(-)
 delete mode 100644 config/initializers/task_list_ext.rb

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
-- 
GitLab