gitlab-org--gitlab-foss/lib/gitlab/github_import/base_formatter.rb

25 lines
562 B
Ruby
Raw Normal View History

module Gitlab
module GithubImport
class BaseFormatter
attr_reader :client, :formatter, :project, :raw_data
def initialize(project, raw_data, client = nil)
@project = project
@raw_data = raw_data
@client = client
@formatter = Gitlab::ImportFormatter.new
end
def create!
2016-10-27 08:54:51 -04:00
project.public_send(project_association).find_or_create_by!(find_condition) do |record|
2016-10-19 14:42:31 -04:00
record.attributes = attributes
end
end
def url
raw_data.url || ''
end
end
end
end