diff options
-rw-r--r-- | changelogs/unreleased/rails5-active-sup-subscriber.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/query_limiting/active_support_subscriber.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/changelogs/unreleased/rails5-active-sup-subscriber.yml b/changelogs/unreleased/rails5-active-sup-subscriber.yml new file mode 100644 index 00000000000..439fa6f428e --- /dev/null +++ b/changelogs/unreleased/rails5-active-sup-subscriber.yml @@ -0,0 +1,5 @@ +--- +title: Make ActiveRecordSubscriber rails 5 compatible +merge_request: +author: +type: other diff --git a/lib/gitlab/query_limiting/active_support_subscriber.rb b/lib/gitlab/query_limiting/active_support_subscriber.rb index 4c83581c4b1..3c4ff5d1928 100644 --- a/lib/gitlab/query_limiting/active_support_subscriber.rb +++ b/lib/gitlab/query_limiting/active_support_subscriber.rb @@ -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 |