Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/import_export/base/object_builder.rb')
-rw-r--r--lib/gitlab/import_export/base/object_builder.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/base/object_builder.rb b/lib/gitlab/import_export/base/object_builder.rb
index 5e9c8292c1e..7dee0f783cc 100644
--- a/lib/gitlab/import_export/base/object_builder.rb
+++ b/lib/gitlab/import_export/base/object_builder.rb
@@ -31,12 +31,18 @@ module Gitlab
def find
find_with_cache do
- find_object || klass.create(prepare_attributes)
+ find_object || create_object
end
end
protected
+ def create_object
+ klass.transaction do
+ klass.create(prepare_attributes)
+ end
+ end
+
def where_clauses
raise NotImplementedError
end