diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-08-06 16:19:15 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-08-16 11:01:02 +0300 |
commit | 358675d09f6ba0fdcc4a089c6d1da6df9ff6d092 (patch) | |
tree | b91c1ecbb1ba0634c99430b55d05e4a9c59d357e /app/models | |
parent | b78a69b06c165f7a463d5e0de69030346d9d5c72 (diff) |
Trigger iid logic from GitHub importer for milestones.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/internal_id.rb | 6 |
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, |