Class: Ci::JobsFinder
- Inherits:
-
Object
- Object
- Ci::JobsFinder
- Includes:
- Gitlab::Allowable
- Defined in:
- app/finders/ci/jobs_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user:, pipeline: nil, project: nil, runner: nil, params: {}, type: ::Ci::Build) ⇒ JobsFinder
constructor
A new instance of JobsFinder.
Methods included from Gitlab::Allowable
Constructor Details
#initialize(current_user:, pipeline: nil, project: nil, runner: nil, params: {}, type: ::Ci::Build) ⇒ JobsFinder
Returns a new instance of JobsFinder.
7 8 9 10 11 12 13 14 15 |
# File 'app/finders/ci/jobs_finder.rb', line 7 def initialize(current_user:, pipeline: nil, project: nil, runner: nil, params: {}, type: ::Ci::Build) @pipeline = pipeline @current_user = current_user @project = project @runner = runner @params = params @type = type raise ArgumentError 'type must be a subclass of Ci::Processable' unless type < ::Ci::Processable end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/finders/ci/jobs_finder.rb', line 17 def execute builds = init_collection.order_id_desc builds = filter_by_with_artifacts(builds) filter_by_scope(builds) rescue Gitlab::Access::AccessDeniedError type.none end |