lograge-sql 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4802776c093c745bdde5c05241a3aa9c8b16fd0f57fa6dd4d2b789ffd10a190a
4
- data.tar.gz: f5a5e9584c8d60f19a7d548be07d765fab93409de923741d7fa715c70f3ffa4e
3
+ metadata.gz: 243947fd13d6fbc92005dd9c1ad82a0e9cc49df4d5bffb87cd82735d1dd85952
4
+ data.tar.gz: c79dd34a14b969d06bf24e43b4adf41153308df55a808038385663ce6c47a9ec
5
5
  SHA512:
6
- metadata.gz: d16f1ff992a2e8c0a1a9a32b615b018347cfd20b8b0948b4820081fad15ada9bf81f347494ffdcaba61c749a3537cd6574a9df9bdb570c1101c6e429dcf4418c
7
- data.tar.gz: 5579fcacbf7f880e90017eaf03b32c09796daa38ea210e27568d4f715d431ad492f80bfb8d26ff71108977734f77c26af4d20213ec6d7136e77f127832ef4f4e
6
+ metadata.gz: bcb2cfebed7798bd67f3ac6c2b5ec48adb1790363dae5241b998c36ccabb47171d0c3339880dc0fccc5bbe63027b75e108e0cd36b0837ec283ccd7e94b2d8d30
7
+ data.tar.gz: 696ec3eb022c3f5abd830c3af207d2d4a7cbf75647263a2a2edac1fed22f9d45857693c30adf10fa041b54ae102db5acb8a0402352cabeebd038503668ab687e
@@ -21,8 +21,13 @@ module Lograge
21
21
  def increase_runtime_duration(event)
22
22
  return if Rails.application.config.lograge_sql.keep_default_active_record_log
23
23
 
24
- ActiveRecord::RuntimeRegistry.sql_runtime ||= 0.0
25
- ActiveRecord::RuntimeRegistry.sql_runtime += event.duration
24
+ if ::ActiveRecord::RuntimeRegistry.respond_to?(:stats)
25
+ ActiveRecord::RuntimeRegistry.stats.sql_runtime ||= 0.0
26
+ ActiveRecord::RuntimeRegistry.stats.sql_runtime += event.duration
27
+ else
28
+ ActiveRecord::RuntimeRegistry.sql_runtime ||= 0.0
29
+ ActiveRecord::RuntimeRegistry.sql_runtime += event.duration
30
+ end
26
31
  end
27
32
 
28
33
  def filter_query(event)
@@ -3,6 +3,6 @@
3
3
  module Lograge
4
4
  module Sql
5
5
  # Gem version
6
- VERSION = '2.6.0'
6
+ VERSION = '2.6.1'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lograge-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Giuffrida