summaryrefslogtreecommitdiff
path: root/app/models/internal_id.rb
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-08-06 15:19:15 +0200
committerAndreas Brandl <abrandl@gitlab.com>2018-08-16 10:01:02 +0200
commit358675d09f6ba0fdcc4a089c6d1da6df9ff6d092 (patch)
treeb91c1ecbb1ba0634c99430b55d05e4a9c59d357e /app/models/internal_id.rb
parentb78a69b06c165f7a463d5e0de69030346d9d5c72 (diff)
downloadgitlab-ce-358675d09f6ba0fdcc4a089c6d1da6df9ff6d092.tar.gz
Trigger iid logic from GitHub importer for milestones.
Diffstat (limited to 'app/models/internal_id.rb')
-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,