debian-mirror-gitlab/app/services/design_management/design_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
587 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# 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
2021-09-04 01:27:46 +05:30
repository.root_ref || Gitlab::DefaultBranch.value(object: project)
2020-05-24 23:13:21 +05:30
end
def collection
issue.design_collection
end
2021-01-03 14:25:43 +05:30
alias_method :design_collection, :collection
2020-05-24 23:13:21 +05:30
def repository
collection.repository
end
def project
issue.project
end
end
end