summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-08-17 14:33:27 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2018-08-17 14:33:27 +0000
commita58d0a0182d06efbbde57821e71c305518325d6f (patch)
tree4caf920f90d558f57fd2e858ecb709bc3fa177de /app
parentc2f14af75e9b65ae8d88d3d025ea63da7bd2106b (diff)
parent729de4f1ba04f1a9a44b7f3f3b9bd5fb9165e4ca (diff)
downloadgitlab-ce-a58d0a0182d06efbbde57821e71c305518325d6f.tar.gz
Merge branch 'ab-49754-gh-importer-internal-ids' into 'master'
GitHub importer: Keep track of internal_ids Closes #49754 See merge request gitlab-org/gitlab-ce!20926
Diffstat (limited to 'app')
-rw-r--r--app/models/internal_id.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/internal_id.rb b/app/models/internal_id.rb
index 4eb211eff61..e7168d49db9 100644
--- a/app/models/internal_id.rb
+++ b/app/models/internal_id.rb
@@ -111,7 +111,7 @@ class InternalId < ActiveRecord::Base
# Generates next internal id and returns it
def generate
- subject.transaction do
+ InternalId.transaction do
# Create a record in internal_ids if one does not yet exist
# and increment its last value
#
@@ -125,7 +125,7 @@ class InternalId < ActiveRecord::Base
#
# Note this will acquire a ROW SHARE lock on the InternalId record
def track_greatest(new_value)
- subject.transaction do
+ InternalId.transaction do
(lookup || create_record).track_greatest_and_save!(new_value)
end
end
@@ -148,7 +148,7 @@ class InternalId < ActiveRecord::Base
# violation. We can safely roll-back the nested transaction and perform
# a lookup instead to retrieve the record.
def create_record
- subject.transaction(requires_new: true) do
+ InternalId.transaction(requires_new: true) do
InternalId.create!(
**scope,
usage: usage_value,