summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-12 02:29:33 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-09-18 21:23:45 +0800
commit9ae92b8caa6c11d8860f86b7d6378062215d1b72 (patch)
tree06b7416abad46cb1dd44c19a18a7e40caed30e15 /app/workers
parent4cadf22e208e3be401824f43ab13d5e6f2ff6465 (diff)
downloadgitlab-ce-9ae92b8caa6c11d8860f86b7d6378062215d1b72.tar.gz
Add cop to make sure we don't use ivar in a module
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/concerns/new_issuable.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/concerns/new_issuable.rb b/app/workers/concerns/new_issuable.rb
index eb0d6c9c36c..b6aea921aae 100644
--- a/app/workers/concerns/new_issuable.rb
+++ b/app/workers/concerns/new_issuable.rb
@@ -8,12 +8,14 @@ module NewIssuable
user && issuable
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def set_user(user_id)
@user = User.find_by(id: user_id)
log_error(User, user_id) unless @user
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def set_issuable(issuable_id)
@issuable = issuable_class.find_by(id: issuable_id)