summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/after_branch_delete_service.rb6
-rw-r--r--app/services/boards/issues/list_service.rb8
-rw-r--r--app/services/boards/lists/destroy_service.rb4
-rw-r--r--app/services/boards/lists/move_service.rb12
-rw-r--r--app/services/ci/create_pipeline_service.rb6
-rw-r--r--app/services/ci/process_pipeline_service.rb6
-rw-r--r--app/services/ci/retry_build_service.rb10
-rw-r--r--app/services/ci/retry_pipeline_service.rb10
-rw-r--r--app/services/commits/change_service.rb4
-rw-r--r--app/services/create_branch_service.rb4
-rw-r--r--app/services/git_push_service.rb10
-rw-r--r--app/services/issues/move_service.rb4
-rw-r--r--app/services/merge_requests/base_service.rb10
-rw-r--r--app/services/merge_requests/refresh_service.rb6
14 files changed, 50 insertions, 50 deletions
diff --git a/app/services/after_branch_delete_service.rb b/app/services/after_branch_delete_service.rb
index 227e9ea9c6d..95492f709bb 100644
--- a/app/services/after_branch_delete_service.rb
+++ b/app/services/after_branch_delete_service.rb
@@ -14,8 +14,8 @@ class AfterBranchDeleteService < BaseService
private
def stop_environments
- Ci::StopEnvironmentsService
- .new(project, current_user)
- .execute(branch_name)
+ Ci::StopEnvironmentsService.
+ new(project, current_user).
+ execute(branch_name)
end
end
diff --git a/app/services/boards/issues/list_service.rb b/app/services/boards/issues/list_service.rb
index 8a94c54b6ab..2d664f3f0c8 100644
--- a/app/services/boards/issues/list_service.rb
+++ b/app/services/boards/issues/list_service.rb
@@ -57,15 +57,15 @@ module Boards
return issues unless board_label_ids.any?
issues.where.not(
- LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id")
- .where(label_id: board_label_ids).limit(1).arel.exists
+ LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id").
+ where(label_id: board_label_ids).limit(1).arel.exists
)
end
def with_list_label(issues)
issues.where(
- LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id")
- .where("label_links.label_id = ?", list.label_id).limit(1).arel.exists
+ LabelLink.where("label_links.target_type = 'Issue' AND label_links.target_id = issues.id").
+ where("label_links.label_id = ?", list.label_id).limit(1).arel.exists
)
end
end
diff --git a/app/services/boards/lists/destroy_service.rb b/app/services/boards/lists/destroy_service.rb
index f986e05944c..6c80dd61873 100644
--- a/app/services/boards/lists/destroy_service.rb
+++ b/app/services/boards/lists/destroy_service.rb
@@ -17,8 +17,8 @@ module Boards
attr_reader :board
def decrement_higher_lists(list)
- board.lists.movable.where('position > ?', list.position)
- .update_all('position = position - 1')
+ board.lists.movable.where('position > ?', list.position).
+ update_all('position = position - 1')
end
def remove_list(list)
diff --git a/app/services/boards/lists/move_service.rb b/app/services/boards/lists/move_service.rb
index f2a68865f7b..2f109934ea9 100644
--- a/app/services/boards/lists/move_service.rb
+++ b/app/services/boards/lists/move_service.rb
@@ -33,15 +33,15 @@ module Boards
end
def decrement_intermediate_lists
- board.lists.movable.where('position > ?', old_position)
- .where('position <= ?', new_position)
- .update_all('position = position - 1')
+ board.lists.movable.where('position > ?', old_position).
+ where('position <= ?', new_position).
+ update_all('position = position - 1')
end
def increment_intermediate_lists
- board.lists.movable.where('position >= ?', new_position)
- .where('position < ?', old_position)
- .update_all('position = position + 1')
+ board.lists.movable.where('position >= ?', new_position).
+ where('position < ?', old_position).
+ update_all('position = position + 1')
end
def update_list_position(list)
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 38a85e9fc42..b53a467655f 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -48,9 +48,9 @@ module Ci
Ci::Pipeline.transaction do
pipeline.save
- Ci::CreatePipelineBuildsService
- .new(project, current_user)
- .execute(pipeline)
+ Ci::CreatePipelineBuildsService.
+ new(project, current_user).
+ execute(pipeline)
end
pipeline.tap(&:process!)
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb
index 79eb97b7b55..442230abe29 100644
--- a/app/services/ci/process_pipeline_service.rb
+++ b/app/services/ci/process_pipeline_service.rb
@@ -78,9 +78,9 @@ module Ci
def ensure_created_builds!
return if created_builds.any?
- Ci::CreatePipelineBuildsService
- .new(project, current_user)
- .execute(pipeline)
+ Ci::CreatePipelineBuildsService.
+ new(project, current_user).
+ execute(pipeline)
end
end
end
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb
index 38ef323f6e5..c1fa9278f0f 100644
--- a/app/services/ci/retry_build_service.rb
+++ b/app/services/ci/retry_build_service.rb
@@ -2,8 +2,8 @@ module Ci
class RetryBuildService < ::BaseService
CLONE_ATTRIBUTES = %i[pipeline project ref tag options commands name
allow_failure stage stage_idx trigger_request
- yaml_variables when environment coverage_regex]
- .freeze
+ yaml_variables when environment coverage_regex].
+ freeze
REJECT_ATTRIBUTES = %i[id status user token coverage trace runner
artifacts_expire_at artifacts_file
@@ -20,9 +20,9 @@ module Ci
new_build.enqueue!
- MergeRequests::AddTodoWhenBuildFailsService
- .new(project, current_user)
- .close(new_build)
+ MergeRequests::AddTodoWhenBuildFailsService.
+ new(project, current_user).
+ close(new_build)
end
end
diff --git a/app/services/ci/retry_pipeline_service.rb b/app/services/ci/retry_pipeline_service.rb
index 2c5e130e5aa..6e9781ca8cf 100644
--- a/app/services/ci/retry_pipeline_service.rb
+++ b/app/services/ci/retry_pipeline_service.rb
@@ -8,13 +8,13 @@ module Ci
pipeline.builds.failed_or_canceled.find_each do |build|
next unless build.retryable?
- Ci::RetryBuildService.new(project, current_user)
- .reprocess(build)
+ Ci::RetryBuildService.new(project, current_user).
+ reprocess(build)
end
- MergeRequests::AddTodoWhenBuildFailsService
- .new(project, current_user)
- .close_all(pipeline)
+ MergeRequests::AddTodoWhenBuildFailsService.
+ new(project, current_user).
+ close_all(pipeline)
pipeline.process!
end
diff --git a/app/services/commits/change_service.rb b/app/services/commits/change_service.rb
index 25e22f14e60..75281837b09 100644
--- a/app/services/commits/change_service.rb
+++ b/app/services/commits/change_service.rb
@@ -70,8 +70,8 @@ module Commits
# Temporary branch exists and contains the change commit
return if repository.find_branch(new_branch)
- result = ValidateNewBranchService.new(@project, current_user)
- .execute(new_branch)
+ result = ValidateNewBranchService.new(@project, current_user).
+ execute(new_branch)
if result[:status] == :error
raise ChangeError, "There was an error creating the source branch: #{result[:message]}"
diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb
index 77459d8779d..1b5e504573a 100644
--- a/app/services/create_branch_service.rb
+++ b/app/services/create_branch_service.rb
@@ -1,7 +1,7 @@
class CreateBranchService < BaseService
def execute(branch_name, ref)
- result = ValidateNewBranchService.new(project, current_user)
- .execute(branch_name)
+ result = ValidateNewBranchService.new(project, current_user).
+ execute(branch_name)
return result if result[:status] == :error
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index dbe2fda27b5..f681f831cbd 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -96,8 +96,8 @@ class GitPushService < BaseService
# Update merge requests that may be affected by this push. A new branch
# could cause the last commit of a merge request to change.
#
- UpdateMergeRequestsWorker
- .perform_async(@project.id, current_user.id, params[:oldrev], params[:newrev], params[:ref])
+ UpdateMergeRequestsWorker.
+ perform_async(@project.id, current_user.id, params[:oldrev], params[:newrev], params[:ref])
EventCreateService.new.push(@project, current_user, build_push_data)
@project.execute_hooks(build_push_data.dup, :push_hooks)
@@ -105,9 +105,9 @@ class GitPushService < BaseService
Ci::CreatePipelineService.new(@project, current_user, build_push_data).execute
if push_remove_branch?
- AfterBranchDeleteService
- .new(project, current_user)
- .execute(branch_name)
+ AfterBranchDeleteService.
+ new(project, current_user).
+ execute(branch_name)
end
end
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb
index a2a5f57d069..17b65947468 100644
--- a/app/services/issues/move_service.rb
+++ b/app/services/issues/move_service.rb
@@ -61,8 +61,8 @@ module Issues
end
def cloneable_milestone_id
- @new_project.milestones
- .find_by(title: @old_issue.milestone.try(:title)).try(:id)
+ @new_project.milestones.
+ find_by(title: @old_issue.milestone.try(:title)).try(:id)
end
def rewrite_notes
diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb
index 5a53b973059..fd9d7de35f4 100644
--- a/app/services/merge_requests/base_service.rb
+++ b/app/services/merge_requests/base_service.rb
@@ -40,11 +40,11 @@ module MergeRequests
# Returns all origin and fork merge requests from `@project` satisfying passed arguments.
def merge_requests_for(source_branch, mr_states: [:opened])
- MergeRequest
- .with_state(mr_states)
- .where(source_branch: source_branch, source_project_id: @project.id)
- .preload(:source_project) # we don't need a #includes since we're just preloading for the #select
- .select(&:source_project)
+ MergeRequest.
+ with_state(mr_states).
+ where(source_branch: source_branch, source_project_id: @project.id).
+ preload(:source_project). # we don't need a #includes since we're just preloading for the #select
+ select(&:source_project)
end
def pipeline_merge_requests(pipeline)
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb
index 581d18032e6..edee3032683 100644
--- a/app/services/merge_requests/refresh_service.rb
+++ b/app/services/merge_requests/refresh_service.rb
@@ -60,9 +60,9 @@ module MergeRequests
by_source_or_target_branch(@branch_name).to_a
# Fork merge requests
- merge_requests += MergeRequest.opened
- .where(source_branch: @branch_name, source_project: @project)
- .where.not(target_project: @project).to_a
+ merge_requests += MergeRequest.opened.
+ where(source_branch: @branch_name, source_project: @project).
+ where.not(target_project: @project).to_a
filter_merge_requests(merge_requests).each do |merge_request|
if merge_request.source_branch == @branch_name || force_push?