summaryrefslogtreecommitdiff
path: root/app/services/base_service.rb
blob: 7ab87a1af091a70a2bf2c2fdd5eca5b4c2e3cb09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

# This is the original root class for service related classes,
# and due to historical reason takes a project as scope.
# Later separate base classes for different scopes will be created,
# and existing service will use these one by one.
# After all are migrated, we can remove this class.
#
# New services should consider inheriting from:
#
# - BaseContainerService for services scoped by container (project or group)
# - BaseProjectService for services scoped to projects
#
# or, create a new base class and update this comment.
class BaseService
  include BaseServiceUtility

  attr_accessor :project, :current_user, :params

  def initialize(project, user = nil, params = {})
    @project = project
    @current_user = user
    @params = params.dup
  end

  delegate :repository, to: :project
end