Skip to content

Commit ce7e781

Browse files
committed
ActiveRecord::RuntimeRegistry.sql_runtime private API moved
See: rails/rails@7d12071
1 parent b5a03bd commit ce7e781

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/rails_semantic_logger/active_record/log_subscriber.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ class << self
88
end
99

1010
def self.runtime=(value)
11-
::ActiveRecord::RuntimeRegistry.sql_runtime = value
11+
::ActiveRecord::RuntimeRegistry.respond_to?(:stats) ?
12+
::ActiveRecord::RuntimeRegistry.stats.sql_runtime = value :
13+
::ActiveRecord::RuntimeRegistry.sql_runtime = value
1214
end
1315

1416
def self.runtime
15-
::ActiveRecord::RuntimeRegistry.sql_runtime ||= 0
17+
::ActiveRecord::RuntimeRegistry.respond_to?(:stats) ?
18+
::ActiveRecord::RuntimeRegistry.stats.sql_runtime ||= 0 :
19+
::ActiveRecord::RuntimeRegistry.sql_runtime ||= 0
1620
end
1721

1822
def self.reset_runtime

0 commit comments

Comments
 (0)