summaryrefslogtreecommitdiff
path: root/app/models/concerns/taskable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/taskable.rb')
-rw-r--r--app/models/concerns/taskable.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/app/models/concerns/taskable.rb b/app/models/concerns/taskable.rb
index f147ce8ad6b..c27792486dd 100644
--- a/app/models/concerns/taskable.rb
+++ b/app/models/concerns/taskable.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require 'task_list'
-require 'task_list/filter'
+require "task_list"
+require "task_list/filter"
# Contains functionality for objects that can have task lists in their
# descriptions. Task list items can be added with Markdown like "* [x] Fix
@@ -9,8 +9,8 @@ require 'task_list/filter'
#
# Used by MergeRequest and Issue
module Taskable
- COMPLETED = 'completed'.freeze
- INCOMPLETE = 'incomplete'.freeze
+ COMPLETED = "completed"
+ INCOMPLETE = "incomplete"
COMPLETE_PATTERN = /(\[[xX]\])/.freeze
INCOMPLETE_PATTERN = /(\[[\s]\])/.freeze
ITEM_PATTERN = %r{
@@ -58,16 +58,16 @@ module Taskable
# Return a string that describes the current state of this Taskable's task
# list items, e.g. "12 of 20 tasks completed"
def task_status(short: false)
- return '' if description.blank?
+ return "" if description.blank?
prep, completed = if short
- ['/', '']
- else
- [' of ', ' completed']
- end
+ ["/", ""]
+ else
+ [" of ", " completed"]
+ end
sum = tasks.summary
- "#{sum.complete_count}#{prep}#{sum.item_count} #{'task'.pluralize(sum.item_count)}#{completed}"
+ "#{sum.complete_count}#{prep}#{sum.item_count} #{"task".pluralize(sum.item_count)}#{completed}"
end
# Return a short string that describes the current state of this Taskable's