Commit 724864ee authored by Semyon Pupkov's avatar Semyon Pupkov

Remove unnecessary require_relative calls from service classes

Rails by default use autoload for all dirs from app folder.
require_relative not needed. See ActiveSupport::Dependencies.autoload_paths
parent 78e34d8a
require_relative 'base_service'
##
# Branch can be deleted either by DeleteBranchService
# or by GitPushService.
......
require_relative 'base_service'
class CreateBranchService < BaseService
def execute(branch_name, ref, source_project: @project)
valid_branch = Gitlab::GitRefValidator.validate(branch_name)
......
require_relative 'base_service'
class CreateDeploymentService < BaseService
def execute(deployable = nil)
return unless executable?
......
require_relative 'base_service'
class CreateReleaseService < BaseService
def execute(tag_name, release_description)
repository = project.repository
......
require_relative 'base_service'
class CreateTagService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
......
require_relative 'base_service'
class DeleteBranchService < BaseService
def execute(branch_name)
repository = project.repository
......
require_relative 'base_service'
class DeleteMergedBranchesService < BaseService
def async_execute
DeleteMergedBranchesWorker.perform_async(project.id, current_user.id)
......
require_relative 'base_service'
class DeleteTagService < BaseService
def execute(tag_name)
repository = project.repository
......
require_relative "base_service"
module Files
class CreateDirService < Files::BaseService
def commit
......
require_relative "base_service"
module Files
class CreateService < Files::BaseService
def commit
......
require_relative "base_service"
module Files
class DeleteService < Files::BaseService
def commit
......
require_relative "base_service"
module Files
class MultiService < Files::BaseService
class FileChangedError < StandardError; end
......
require_relative "base_service"
module Files
class UpdateService < Files::BaseService
class FileChangedError < StandardError; end
......
require_relative 'base_service'
require_relative 'reopen_service'
require_relative 'close_service'
module MergeRequests
class UpdateService < MergeRequests::BaseService
def execute(merge_request)
......
require_relative 'base_service'
class UpdateReleaseService < BaseService
def execute(tag_name, release_description)
repository = project.repository
......
---
title: 'Remove unnecessary require_relative calls from service classes'
merge_request: '7601'
author: Semyon Pupkov
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment