Welcome to mirror list, hosted at ThFree Co, Russian Federation.

design_service.rb « design_management « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5aa2a2f73bc3b12e123a7b727e9c08743ec13fcb (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
28
29
30
31
32
# frozen_string_literal: true

module DesignManagement
  class DesignService < ::BaseService
    def initialize(project, user, params = {})
      super

      @issue = params.fetch(:issue)
    end

    # Accessors common to all subclasses:

    attr_reader :issue

    def target_branch
      repository.root_ref || "master"
    end

    def collection
      issue.design_collection
    end
    alias_method :design_collection, :collection

    def repository
      collection.repository
    end

    def project
      issue.project
    end
  end
end