Class: Ci::RunnersFinder
- Inherits:
-
UnionFinder
- Object
- UnionFinder
- Ci::RunnersFinder
- Includes:
- Gitlab::Allowable
- Defined in:
- app/finders/ci/runners_finder.rb
Constant Summary collapse
- DEFAULT_SORT =
'created_at_desc'
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user:, 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:, params:) ⇒ RunnersFinder
Returns a new instance of RunnersFinder.
9 10 11 12 13 14 |
# File 'app/finders/ci/runners_finder.rb', line 9 def initialize(current_user:, params:) @params = params @group = params.delete(:group) @project = params.delete(:project) @current_user = current_user end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/finders/ci/runners_finder.rb', line 16 def execute search! filter_by_active! filter_by_status! filter_by_upgrade_status! filter_by_runner_type! filter_by_tag_list! sort! request_tag_list! @runners end |
#sort_key ⇒ Object
29 30 31 |
# File 'app/finders/ci/runners_finder.rb', line 29 def sort_key allowed_sorts.include?(@params[:sort]) ? @params[:sort] : DEFAULT_SORT end |