Class: Todos::Destroy::ConfidentialIssueService

Inherits:
BaseService
  • Object
show all
Extended by:
Gitlab::Utils::Override
Defined in:
app/services/todos/destroy/confidential_issue_service.rb

Overview

Service class for deleting todos that belongs to confidential issues. It deletes todos for users that are not at least reporters, issue author or assignee.

Accepts issue_id or project_id as argument. When issue_id is passed it deletes matching todos for one confidential issue. When project_id is passed it deletes matching todos for all confidential issues of the project.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from BaseService

#execute

Constructor Details

#initialize(issue_id: nil, project_id: nil) ⇒ ConfidentialIssueService

rubocop: disable CodeReuse/ActiveRecord


17
18
19
20
21
22
23
24
# File 'app/services/todos/destroy/confidential_issue_service.rb', line 17

def initialize(issue_id: nil, project_id: nil)
  @issues =
    if issue_id
      Issue.where(id: issue_id)
    elsif project_id
      project_confidential_issues(project_id)
    end
end

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.


14
15
16
# File 'app/services/todos/destroy/confidential_issue_service.rb', line 14

def issues
  @issues
end