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:
authordixpac <dino.onex@gmail.com>2017-02-09 22:32:09 +0300
committerdixpac <dino.onex@gmail.com>2017-02-10 20:22:18 +0300
commitfa2339641f52688ba2465f4c602c1de36fe5b353 (patch)
tree0102c261cba0da263b7d6fee90a03fe267b2eec0
parent6cbfe1396d6627f156f109f414215db426b846ad (diff)
Rename Files::DeleteService to Files::DestroyService
Reason for renaming is to comply with naming convention of services in codebase.
-rw-r--r--app/controllers/projects/blob_controller.rb8
-rw-r--r--app/services/files/destroy_service.rb (renamed from app/services/files/delete_service.rb)2
-rw-r--r--changelogs/unreleased/rename_files_delete_service.yml4
-rw-r--r--lib/api/files.rb2
-rw-r--r--spec/lib/gitlab/diff/position_tracer_spec.rb2
5 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 4c39fe98028..a1db856dcfb 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -61,10 +61,10 @@ class Projects::BlobController < Projects::ApplicationController
end
def destroy
- create_commit(Files::DeleteService, success_notice: "The file has been successfully deleted.",
- success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch),
- failure_view: :show,
- failure_path: namespace_project_blob_path(@project.namespace, @project, @id))
+ create_commit(Files::DestroyService, success_notice: "The file has been successfully deleted.",
+ success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch),
+ failure_view: :show,
+ failure_path: namespace_project_blob_path(@project.namespace, @project, @id))
end
def diff
diff --git a/app/services/files/delete_service.rb b/app/services/files/destroy_service.rb
index 50f0ffcac9f..c3be806a42d 100644
--- a/app/services/files/delete_service.rb
+++ b/app/services/files/destroy_service.rb
@@ -1,5 +1,5 @@
module Files
- class DeleteService < Files::BaseService
+ class DestroyService < Files::BaseService
def commit
repository.remove_file(
current_user,
diff --git a/changelogs/unreleased/rename_files_delete_service.yml b/changelogs/unreleased/rename_files_delete_service.yml
new file mode 100644
index 00000000000..4de1c5b0d63
--- /dev/null
+++ b/changelogs/unreleased/rename_files_delete_service.yml
@@ -0,0 +1,4 @@
+---
+title: Rename Files::DeleteService to Files::DestroyService
+merge_request: 9110
+author: dixpac
diff --git a/lib/api/files.rb b/lib/api/files.rb
index c58472de578..2ecdd747c8e 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -117,7 +117,7 @@ module API
authorize! :push_code, user_project
file_params = declared_params(include_missing: false)
- result = ::Files::DeleteService.new(user_project, current_user, commit_params(file_params)).execute
+ result = ::Files::DestroyService.new(user_project, current_user, commit_params(file_params)).execute
if result[:status] == :success
status(200)
diff --git a/spec/lib/gitlab/diff/position_tracer_spec.rb b/spec/lib/gitlab/diff/position_tracer_spec.rb
index 8e3e4034c8f..994995b57b8 100644
--- a/spec/lib/gitlab/diff/position_tracer_spec.rb
+++ b/spec/lib/gitlab/diff/position_tracer_spec.rb
@@ -122,7 +122,7 @@ describe Gitlab::Diff::PositionTracer, lib: true do
end
def delete_file(branch_name, file_name)
- Files::DeleteService.new(
+ Files::DestroyService.new(
project,
current_user,
start_branch: branch_name,