diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 18:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 18:06:26 +0300 |
commit | 69944ffb68788d190e81ff7e33db5dcb6c903184 (patch) | |
tree | 4112a1285f186c140749e8410a8a2788b6812500 /app/services | |
parent | 1b7381e998ff4b33ec8f633766030082e95f10c8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/register_job_service.rb | 2 | ||||
-rw-r--r-- | app/services/cohorts_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index ff140444c1c..30e2a66e04a 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -149,7 +149,7 @@ module Ci # this returns builds that are ordered by number of running builds # we prefer projects that don't use shared runners at all joins("LEFT JOIN (#{running_builds_for_shared_runners.to_sql}) AS project_builds ON ci_builds.project_id=project_builds.project_id") - .order('COALESCE(project_builds.running_builds, 0) ASC', 'ci_builds.id ASC') + .order(Arel.sql('COALESCE(project_builds.running_builds, 0) ASC'), 'ci_builds.id ASC') end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/services/cohorts_service.rb b/app/services/cohorts_service.rb index 97fbb70f350..dbbe89ef260 100644 --- a/app/services/cohorts_service.rb +++ b/app/services/cohorts_service.rb @@ -88,7 +88,7 @@ class CohortsService User .where('created_at > ?', MONTHS_INCLUDED.months.ago.end_of_month) .group(created_at_month, last_activity_on_month) - .reorder("#{created_at_month} ASC", "#{last_activity_on_month} ASC") + .reorder(Arel.sql("#{created_at_month} ASC, #{last_activity_on_month} ASC")) .count end end |