Module: NewIssuable
- Included in:
- NewIssueWorker, NewMergeRequestWorker
- Defined in:
- app/workers/concerns/new_issuable.rb
Instance Attribute Summary collapse
-
#issuable ⇒ Object
readonly
Returns the value of attribute issuable.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #log_error(record_class, record_id) ⇒ Object
- #objects_found?(issuable_id, user_id) ⇒ Boolean
- #set_issuable(issuable_id) ⇒ Object
- #set_user(user_id) ⇒ Object
Instance Attribute Details
#issuable ⇒ Object (readonly)
Returns the value of attribute issuable.
4 5 6 |
# File 'app/workers/concerns/new_issuable.rb', line 4 def issuable @issuable end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'app/workers/concerns/new_issuable.rb', line 4 def user @user end |
Instance Method Details
#log_error(record_class, record_id) ⇒ Object
25 26 27 |
# File 'app/workers/concerns/new_issuable.rb', line 25 def log_error(record_class, record_id) Gitlab::AppLogger.error("#{self.class}: couldn't find #{record_class} with ID=#{record_id}, skipping job") end |
#objects_found?(issuable_id, user_id) ⇒ Boolean
6 7 8 9 10 11 |
# File 'app/workers/concerns/new_issuable.rb', line 6 def objects_found?(issuable_id, user_id) set_user(user_id) set_issuable(issuable_id) user && issuable end |
#set_issuable(issuable_id) ⇒ Object
19 20 21 22 23 |
# File 'app/workers/concerns/new_issuable.rb', line 19 def set_issuable(issuable_id) @issuable = issuable_class.find_by_id(issuable_id) # rubocop:disable Gitlab/ModuleWithInstanceVariables log_error(issuable_class, issuable_id) unless @issuable # rubocop:disable Gitlab/ModuleWithInstanceVariables end |
#set_user(user_id) ⇒ Object
13 14 15 16 17 |
# File 'app/workers/concerns/new_issuable.rb', line 13 def set_user(user_id) @user = User.find_by_id(user_id) # rubocop:disable Gitlab/ModuleWithInstanceVariables log_error(User, user_id) unless @user # rubocop:disable Gitlab/ModuleWithInstanceVariables end |