gitlab-org--gitlab-foss/app/services/projects/create_from_template_service.rb
Z.J. van de Weg 3baf3dc955
Rename GitLabProjectImporterService and misc fixes
First round of review, main changes:
- templates.title is human readable, #name will be passed around
- GitLabProjectImporterService has been renamed
2017-08-01 14:36:42 +02:00

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