diff options
Diffstat (limited to 'lib/gitlab/import_export/base/object_builder.rb')
-rw-r--r-- | lib/gitlab/import_export/base/object_builder.rb | 8 |
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 |