Merge branch 'rails5-active-sup-subscriber' into 'master'

Make ActiveRecordSubscriber rails 5 compatible

Closes #44702

See merge request gitlab-org/gitlab-ce!19276
This commit is contained in:
Rémy Coutable 2018-05-31 16:21:13 +00:00
commit 02f8f900da
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
title: Make ActiveRecordSubscriber rails 5 compatible
merge_request:
author:
type: other

View File

@ -4,7 +4,7 @@ module Gitlab
attach_to :active_record
def sql(event)
unless event.payload[:name] == 'CACHE'
unless event.payload.fetch(:cached, event.payload[:name] == 'CACHE')
Transaction.current&.increment
end
end