diff options
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/project_tree_restorer.rb | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 6a859af73c3..28c16d4037f 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -452,7 +452,7 @@ module Ci end def serializable_hash(options = {}) - super(options.merge(when: read_attribute(:when))) + super(options).merge(when: read_attribute(:when)) end private diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index 4c17f13b851..dec8a4c8cab 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -53,11 +53,9 @@ module Gitlab # Finally, it updates each attribute in the newly imported project. def create_relations default_relation_list.each do |relation| - next unless relation.is_a?(Hash) || @tree_hash[relation.to_s].present? - if relation.is_a?(Hash) create_sub_relations(relation, @tree_hash) - else + elsif @tree_hash[relation.to_s].present? relation_key = relation.is_a?(Hash) ? relation.keys.first : relation save_relation_hash(@tree_hash[relation_key.to_s], relation_key) end |