summaryrefslogtreecommitdiff
path: root/app/services/design_management/design_service.rb
blob: 54e5360964619eb983ac552d1364599b7d7482f1 (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
# 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

    def repository
      collection.repository
    end

    def project
      issue.project
    end
  end
end