Class: Ci::RunnerJobsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/ci/runner_jobs_finder.rb

Constant Summary collapse

ALLOWED_INDEXED_COLUMNS =
%w[id].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner, current_user, params = {}) ⇒ RunnerJobsFinder

Returns a new instance of RunnerJobsFinder.



9
10
11
12
13
# File 'app/finders/ci/runner_jobs_finder.rb', line 9

def initialize(runner, current_user, params = {})
  @runner = runner
  @user = current_user
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'app/finders/ci/runner_jobs_finder.rb', line 5

def params
  @params
end

#runnerObject (readonly)

Returns the value of attribute runner.



5
6
7
# File 'app/finders/ci/runner_jobs_finder.rb', line 5

def runner
  @runner
end

Instance Method Details

#executeObject



15
16
17
18
19
20
# File 'app/finders/ci/runner_jobs_finder.rb', line 15

def execute
  items = @runner.builds
  items = by_permission(items)
  items = by_status(items)
  sort_items(items)
end