diff options
author | Xavier Noria <fxn@hashref.com> | 2013-04-13 09:04:44 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-04-13 09:04:44 +0200 |
commit | 11c697383e6fea7834ee1a8ba2815ff0da20f0fe (patch) | |
tree | 925e9688fb76c78df6dfc5eff4cdea9b77b6e2de /activerecord/lib/active_record/log_subscriber.rb | |
parent | a548c4591b014e12b54b9b336a33164df93b0625 (diff) | |
download | rails-11c697383e6fea7834ee1a8ba2815ff0da20f0fe.tar.gz rails-11c697383e6fea7834ee1a8ba2815ff0da20f0fe.tar.bz2 rails-11c697383e6fea7834ee1a8ba2815ff0da20f0fe.zip |
removes calls to AR::Runtime.instance
Registries have class-level accessors to write clean code, let's
use them. This makes style uniform also with existing usage in
ScopeRegistry and InstrumentationRegistry.
If performance of the method_missing callback was ever considered to
be a concern, then we should stop using it altogether and probably
remove the callback. But while we have the feature we should use it.
Diffstat (limited to 'activerecord/lib/active_record/log_subscriber.rb')
-rw-r--r-- | activerecord/lib/active_record/log_subscriber.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index 69371a1dab..61e5c120df 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -3,11 +3,11 @@ module ActiveRecord IGNORE_PAYLOAD_NAMES = ["SCHEMA", "EXPLAIN"] def self.runtime=(value) - ActiveRecord::RuntimeRegistry.instance.sql_runtime = value + ActiveRecord::RuntimeRegistry.sql_runtime = value end def self.runtime - ActiveRecord::RuntimeRegistry.instance.sql_runtime ||= 0 + ActiveRecord::RuntimeRegistry.sql_runtime ||= 0 end def self.reset_runtime |