Class: Ci::CommitStatusesFinder

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/finders/ci/commit_statuses_finder.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(project, repository, current_user, refs) ⇒ CommitStatusesFinder

Returns a new instance of CommitStatusesFinder.


7
8
9
10
11
12
# File 'app/finders/ci/commit_statuses_finder.rb', line 7

def initialize(project, repository, current_user, refs)
  @project = project
  @repository = repository
  @current_user = current_user
  @refs = refs
end

Instance Method Details

#executeObject


14
15
16
17
18
# File 'app/finders/ci/commit_statuses_finder.rb', line 14

def execute
  return {} unless Ability.allowed?(@current_user, :read_pipeline, @project)

  commit_statuses
end