diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-08-26 13:15:00 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-08-26 13:58:20 +0300 |
commit | df6c9c33b69e411d4f7d27cc46e9769a07d12285 (patch) | |
tree | 0a6e0a20a2371c0462371001542a34a9c9d00537 /app/models/cycle_analytics | |
parent | a81de9ab4fc3c3720449069e91ee2431fd9eb024 (diff) |
Scope Cycle Analytics queries to a project
Diffstat (limited to 'app/models/cycle_analytics')
-rw-r--r-- | app/models/cycle_analytics/queries.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/cycle_analytics/queries.rb b/app/models/cycle_analytics/queries.rb index 1074b62039b..122b2599bd3 100644 --- a/app/models/cycle_analytics/queries.rb +++ b/app/models/cycle_analytics/queries.rb @@ -1,12 +1,12 @@ class CycleAnalytics module Queries class << self - def issues - Issue.all.to_a.map { |issue| { issue: issue } } + def issues(project) + project.issues.map { |issue| { issue: issue } } end - def merge_requests_closing_issues - issues.map do |data_point| + def merge_requests_closing_issues(project) + issues(project).map do |data_point| merge_requests = data_point[:issue].closed_by_merge_requests(nil, check_if_open: false) merge_requests.map { |merge_request| { issue: data_point[:issue], merge_request: merge_request } } end.flatten |