Move create! method from formatters to the BaseFormatter

parent 9437b8a2
......@@ -9,6 +9,10 @@ module Gitlab
@formatter = Gitlab::ImportFormatter.new
end
def create!
self.klass.create!(self.attributes)
end
private
def gl_user_id(github_id)
......
......@@ -16,14 +16,14 @@ module Gitlab
}
end
def create!
Issue.create!(self.attributes)
end
def has_comments?
raw_data.comments > 0
end
def klass
Issue
end
def number
raw_data.number
end
......
......@@ -9,8 +9,8 @@ module Gitlab
}
end
def create!
Label.create!(self.attributes)
def klass
Label
end
private
......
......@@ -14,8 +14,8 @@ module Gitlab
}
end
def create!
Milestone.create!(self.attributes)
def klass
Milestone
end
private
......
......@@ -24,8 +24,8 @@ module Gitlab
}
end
def create!
MergeRequest.create!(self.attributes)
def klass
MergeRequest
end
def number
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment