Class: DesignManagement::DesignService

Inherits:
BaseService show all
Defined in:
app/services/design_management/design_service.rb

Instance Attribute Summary collapse

Attributes inherited from BaseService

#current_user, #params

Instance Method Summary collapse

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(project, user, params = {}) ⇒ DesignService

Returns a new instance of DesignService.


5
6
7
8
9
# File 'app/services/design_management/design_service.rb', line 5

def initialize(project, user, params = {})
  super

  @issue = params.fetch(:issue)
end

Instance Attribute Details

#issueObject (readonly)

Accessors common to all subclasses:


13
14
15
# File 'app/services/design_management/design_service.rb', line 13

def issue
  @issue
end

Instance Method Details

#collectionObject Also known as: design_collection


19
20
21
# File 'app/services/design_management/design_service.rb', line 19

def collection
  issue.design_collection
end

#projectObject


28
29
30
# File 'app/services/design_management/design_service.rb', line 28

def project
  issue.project
end

#repositoryObject


24
25
26
# File 'app/services/design_management/design_service.rb', line 24

def repository
  collection.repository
end

#target_branchObject


15
16
17
# File 'app/services/design_management/design_service.rb', line 15

def target_branch
  repository.root_ref || Gitlab::DefaultBranch.value(object: project)
end