summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-26 01:54:42 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-07-12 10:15:31 +0800
commitaeb67dd489b1ccc7f0ab1d702725729ab9cc3e27 (patch)
treec508ba9459274be6a8a0488a838d31f03f45faba /app/services
parentecffca5d92353d55aaf8f984737fa617782310e0 (diff)
downloadgitlab-ce-aeb67dd489b1ccc7f0ab1d702725729ab9cc3e27.tar.gz
Upgrade to Rails 5.2upgrade-rails-5-2-ce
Updates changed method names and fixes spec failures
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/process_pipeline_service.rb4
-rw-r--r--app/services/groups/create_service.rb3
2 files changed, 3 insertions, 4 deletions
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb
index 4a7ce00b8e2..aaf56048b5c 100644
--- a/app/services/ci/process_pipeline_service.rb
+++ b/app/services/ci/process_pipeline_service.rb
@@ -44,7 +44,7 @@ module Ci
# rubocop: disable CodeReuse/ActiveRecord
def stage_indexes_of_created_processables
- created_processables.order(:stage_idx).pluck('distinct stage_idx')
+ created_processables.order(:stage_idx).pluck(Arel.sql('DISTINCT stage_idx'))
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -68,7 +68,7 @@ module Ci
latest_statuses = pipeline.statuses.latest
.group(:name)
.having('count(*) > 1')
- .pluck('max(id)', 'name')
+ .pluck(Arel.sql('MAX(id)'), 'name')
# mark builds that are retried
pipeline.statuses.latest
diff --git a/app/services/groups/create_service.rb b/app/services/groups/create_service.rb
index e9659f5489a..e78e5d5fc2c 100644
--- a/app/services/groups/create_service.rb
+++ b/app/services/groups/create_service.rb
@@ -27,8 +27,7 @@ module Groups
@group.build_chat_team(name: response['name'], team_id: response['id'])
end
- @group.save
- @group.add_owner(current_user)
+ @group.add_owner(current_user) if @group.save
@group
end