debian-mirror-gitlab/app/services/base_project_service.rb

25 lines
489 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# frozen_string_literal: true
# Base class, scoped by project
class BaseProjectService < ::BaseContainerService
2021-11-18 22:05:49 +05:30
include ::Gitlab::Utils::StrongMemoize
2021-06-08 01:23:25 +05:30
attr_accessor :project
def initialize(project:, current_user: nil, params: {})
super(container: project, current_user: current_user, params: params)
@project = project
end
delegate :repository, to: :project
2021-11-18 22:05:49 +05:30
private
def project_group
strong_memoize(:project_group) do
project.group
end
end
2021-06-08 01:23:25 +05:30
end