debian-mirror-gitlab/app/services/projects/create_from_template_service.rb
2017-09-10 17:25:29 +05:30

15 lines
377 B
Ruby

module Projects
class CreateFromTemplateService < BaseService
def initialize(user, params)
@current_user, @params = user, params.dup
end
def execute
params[:file] = Gitlab::ProjectTemplate.find(params[:template_name]).file
GitlabProjectsImportService.new(@current_user, @params).execute
ensure
params[:file]&.close
end
end
end