2d1e0a0811
The returned email by the GitHub API is the user's publicly visible email address (or null if the user has not specified a public email address in their profile)
24 lines
562 B
Ruby
24 lines
562 B
Ruby
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!
|
|
project.public_send(project_association).find_or_create_by!(find_condition) do |record|
|
|
record.attributes = attributes
|
|
end
|
|
end
|
|
|
|
def url
|
|
raw_data.url || ''
|
|
end
|
|
end
|
|
end
|
|
end
|