diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-11-17 15:27:16 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-17 20:01:53 +0300 |
commit | 9ac0c76b78cd04b2505924f003dd720a0f155959 (patch) | |
tree | 67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /lib/gitlab/slash_commands/presenters | |
parent | 0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff) |
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'lib/gitlab/slash_commands/presenters')
-rw-r--r-- | lib/gitlab/slash_commands/presenters/issue_base.rb | 17 |
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 |