mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 14:46:05 +10:00
fixed issue exporting builds
This commit is contained in:
@@ -22,7 +22,7 @@ module Gitlab
|
|||||||
update_user_references(relation_hash, members_mapper.map)
|
update_user_references(relation_hash, members_mapper.map)
|
||||||
update_project_references(relation_hash, klass)
|
update_project_references(relation_hash, klass)
|
||||||
|
|
||||||
imported_object(klass, relation_hash)
|
generate_imported_object(klass, relation_hash, relation_sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -58,6 +58,18 @@ module Gitlab
|
|||||||
"\n\n *By #{author_name} on #{timestamp} (imported from GitLab project)*"
|
"\n\n *By #{author_name} on #{timestamp} (imported from GitLab project)*"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def generate_imported_object(klass, relation_hash, relation_sym)
|
||||||
|
if relation_sym == 'commit_status' # call #trace= method after assigning the other attributes
|
||||||
|
trace = relation_hash.delete('trace')
|
||||||
|
imported_object(klass, relation_hash) do |imported_object|
|
||||||
|
imported_object.trace = trace
|
||||||
|
imported_object.commit_id = nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
imported_object(klass, relation_hash)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def update_project_references(relation_hash, klass)
|
def update_project_references(relation_hash, klass)
|
||||||
project_id = relation_hash.delete('project_id')
|
project_id = relation_hash.delete('project_id')
|
||||||
|
|
||||||
@@ -86,6 +98,7 @@ module Gitlab
|
|||||||
|
|
||||||
def imported_object(klass, relation_hash)
|
def imported_object(klass, relation_hash)
|
||||||
imported_object = klass.new(relation_hash)
|
imported_object = klass.new(relation_hash)
|
||||||
|
yield(imported_object) if block_given?
|
||||||
imported_object.importing = true if imported_object.respond_to?(:importing)
|
imported_object.importing = true if imported_object.respond_to?(:importing)
|
||||||
imported_object
|
imported_object
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user