summaryrefslogtreecommitdiff
path: root/lib/gitlab/slash_commands
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-11-17 20:27:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-11-18 01:01:53 +0800
commit9ac0c76b78cd04b2505924f003dd720a0f155959 (patch)
tree67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /lib/gitlab/slash_commands
parent0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff)
downloadgitlab-ce-9ac0c76b78cd04b2505924f003dd720a0f155959.tar.gz
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'lib/gitlab/slash_commands')
-rw-r--r--lib/gitlab/slash_commands/presenters/issue_base.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/gitlab/slash_commands/presenters/issue_base.rb b/lib/gitlab/slash_commands/presenters/issue_base.rb
index 5aaf3655396..31c1e97efba 100644
--- a/lib/gitlab/slash_commands/presenters/issue_base.rb
+++ b/lib/gitlab/slash_commands/presenters/issue_base.rb
@@ -10,36 +10,37 @@ module Gitlab
issuable.open? ? 'Open' : 'Closed'
end
- # rubocop:disable Cop/ModuleWithInstanceVariables
def project
- @resource.project
+ resource.project
end
- # rubocop:disable Cop/ModuleWithInstanceVariables
def author
- @resource.author
+ resource.author
end
- # rubocop:disable Cop/ModuleWithInstanceVariables
def fields
[
{
title: "Assignee",
- value: @resource.assignees.any? ? @resource.assignees.first.name : "_None_",
+ value: resource.assignees.any? ? resource.assignees.first.name : "_None_",
short: true
},
{
title: "Milestone",
- value: @resource.milestone ? @resource.milestone.title : "_None_",
+ value: resource.milestone ? resource.milestone.title : "_None_",
short: true
},
{
title: "Labels",
- value: @resource.labels.any? ? @resource.label_names.join(', ') : "_None_",
+ value: resource.labels.any? ? resource.label_names.join(', ') : "_None_",
short: true
}
]
end
+
+ private
+
+ attr_reader :resource
end
end
end