Class: Gitlab::PhabricatorImport::ProjectCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/phabricator_import/project_creator.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_user, params) ⇒ ProjectCreator

Returns a new instance of ProjectCreator.


6
7
8
9
# File 'lib/gitlab/phabricator_import/project_creator.rb', line 6

def initialize(current_user, params)
  @current_user = current_user
  @params = params.dup
end

Instance Method Details

#executeObject


11
12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/phabricator_import/project_creator.rb', line 11

def execute
  return unless import_url.present? && api_token.present?

  project = Projects::CreateService.new(current_user, create_params).execute
  return project unless project.persisted?

  project.project_feature.update!(project_feature_attributes)

  project
end