2016-01-14 18:37:52 +05:30
|
|
|
module Gitlab
|
|
|
|
module GithubImport
|
|
|
|
class BaseFormatter
|
|
|
|
attr_reader :formatter, :project, :raw_data
|
|
|
|
|
|
|
|
def initialize(project, raw_data)
|
|
|
|
@project = project
|
|
|
|
@raw_data = raw_data
|
|
|
|
@formatter = Gitlab::ImportFormatter.new
|
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
def create!
|
|
|
|
self.klass.create!(self.attributes)
|
|
|
|
end
|
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def gl_user_id(github_id)
|
|
|
|
User.joins(:identities).
|
|
|
|
find_by("identities.extern_uid = ? AND identities.provider = 'github'", github_id.to_s).
|
|
|
|
try(:id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|