Class: MergeRequest::MetricsFinder

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Allowable
Defined in:
app/finders/merge_request/metrics_finder.rb

Instance Method Summary collapse

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Constructor Details

#initialize(current_user, params = {}) ⇒ MetricsFinder

Returns a new instance of MetricsFinder.



6
7
8
9
# File 'app/finders/merge_request/metrics_finder.rb', line 6

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

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
# File 'app/finders/merge_request/metrics_finder.rb', line 11

def execute
  return klass.none if target_project.blank? || user_not_authorized?

  items = init_collection
  items = by_target_project(items)
  items = by_merged_after(items)
  by_merged_before(items)
end