Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-11 21:29:33 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-09-18 16:23:45 +0300
commit9ae92b8caa6c11d8860f86b7d6378062215d1b72 (patch)
tree06b7416abad46cb1dd44c19a18a7e40caed30e15 /app/models/concerns/noteable.rb
parent4cadf22e208e3be401824f43ab13d5e6f2ff6465 (diff)
Add cop to make sure we don't use ivar in a module
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r--app/models/concerns/noteable.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb
index 1c4ddabcad5..143f4a12bba 100644
--- a/app/models/concerns/noteable.rb
+++ b/app/models/concerns/noteable.rb
@@ -12,6 +12,7 @@ module Noteable
#
# noteable.class # => MergeRequest
# noteable.human_class_name # => "merge request"
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def human_class_name
@human_class_name ||= base_class_name.titleize.downcase
end
@@ -34,6 +35,7 @@ module Noteable
delegate :find_discussion, to: :discussion_notes
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def discussions
@discussions ||= discussion_notes
.inc_relations_for_view
@@ -46,6 +48,7 @@ module Noteable
notes.inc_relations_for_view.grouped_diff_discussions(*args)
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def resolvable_discussions
@resolvable_discussions ||=
if defined?(@discussions)
@@ -67,6 +70,7 @@ module Noteable
discussions_resolvable? && !discussions_resolved?
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def discussions_to_be_resolved
@discussions_to_be_resolved ||= resolvable_discussions.select(&:to_be_resolved?)
end