Class: Ci::RunnersFinder
- Inherits:
-
UnionFinder
- Object
- UnionFinder
- Ci::RunnersFinder
- Includes:
- Gitlab::Allowable
- Defined in:
- app/finders/ci/runners_finder.rb
Constant Summary collapse
- NUMBER_OF_RUNNERS_PER_PAGE =
30
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user:, group: nil, params:) ⇒ RunnersFinder
constructor
A new instance of RunnersFinder.
- #sort_key ⇒ Object
Methods included from Gitlab::Allowable
Methods inherited from UnionFinder
Constructor Details
#initialize(current_user:, group: nil, params:) ⇒ RunnersFinder
Returns a new instance of RunnersFinder.
9 10 11 12 13 |
# File 'app/finders/ci/runners_finder.rb', line 9 def initialize(current_user:, group: nil, params:) @params = params @group = group @current_user = current_user end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/finders/ci/runners_finder.rb', line 15 def execute search! filter_by_status! filter_by_runner_type! filter_by_tag_list! sort! paginate! @runners. rescue Gitlab::Access::AccessDeniedError Ci::Runner.none end |
#sort_key ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/finders/ci/runners_finder.rb', line 29 def sort_key if @params[:sort] == 'contacted_asc' 'contacted_asc' else 'created_date' end end |