Commit ffc16c43 authored by Igor Drozdov's avatar Igor Drozdov

Skip running after commit when transaction's records are nil

The following commit:

https://github.com/rails/rails/commit/05c718a109184440ecc3e254e13f1145c30b2a6c

Introduces changes after which ActiveRecord transaction's
records may return nil
parent f7c62cc0
......@@ -16,7 +16,7 @@ module AfterCommitQueue
def run_after_commit_or_now(&block)
if Gitlab::Database.inside_transaction?
if ActiveRecord::Base.connection.current_transaction.records.include?(self)
if ActiveRecord::Base.connection.current_transaction.records&.include?(self)
run_after_commit(&block)
else
# If the current transaction does not include this record, we can run
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment