Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-02-09 17:10:58 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-28 13:46:19 +0300
commit7c109c575016eb0596e20180b334ca2955bd33e6 (patch)
treea24bcb16fea7c81b30d3fe7d3d2292d2a90d3295 /lib/gitlab/cycle_analytics
parenta7b3f11edd626b7ba2fe4101951d2c9fe884b04a (diff)
Refactor CycleAnalytics base stage class and model
Diffstat (limited to 'lib/gitlab/cycle_analytics')
-rw-r--r--lib/gitlab/cycle_analytics/base_query.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/gitlab/cycle_analytics/base_query.rb b/lib/gitlab/cycle_analytics/base_query.rb
index fee46fc0dda..05263dd30bc 100644
--- a/lib/gitlab/cycle_analytics/base_query.rb
+++ b/lib/gitlab/cycle_analytics/base_query.rb
@@ -14,7 +14,7 @@ module Gitlab
def stage_query
query = mr_closing_issues_table.join(issue_table).on(issue_table[:id].eq(mr_closing_issues_table[:issue_id]))
.join(issue_metrics_table).on(issue_table[:id].eq(issue_metrics_table[:issue_id]))
- .where(issue_table[:project_id].in(project_ids)) # rubocop:disable Gitlab/ModuleWithInstanceVariables
+ .where(issue_table[:project_id].in(Arel.sql(@projects.select(:id).to_sql))) # rubocop:disable Gitlab/ModuleWithInstanceVariables
.where(issue_table[:created_at].gteq(@options[:from])) # rubocop:disable Gitlab/ModuleWithInstanceVariables
# Load merge_requests
@@ -26,10 +26,6 @@ module Gitlab
query
end
-
- def project_ids
- @projects.map(&:id)
- end
end
end
end