diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-10-26 15:51:02 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-10-26 15:51:02 +0100 |
commit | 9e4c41c903e8e58721f2c41776a8c60ddba7a0a9 (patch) | |
tree | d580824995d5ea4866b1d976818f3e3d03a02e53 /activerecord/lib/active_record/explain.rb | |
parent | a27b5178d9f1011545ecbf94008c5d890bab25d0 (diff) | |
download | rails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.tar.gz rails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.tar.bz2 rails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.zip |
Remove ActiveRecord::Model
In the end I think the pain of implementing this seamlessly was not
worth the gain provided.
The intention was that it would allow plain ruby objects that might not
live in your main application to be subclassed and have persistence
mixed in. But I've decided that the benefit of doing that is not worth
the amount of complexity that the implementation introduced.
Diffstat (limited to 'activerecord/lib/active_record/explain.rb')
-rw-r--r-- | activerecord/lib/active_record/explain.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/explain.rb b/activerecord/lib/active_record/explain.rb index 9e0390bed1..af772996f1 100644 --- a/activerecord/lib/active_record/explain.rb +++ b/activerecord/lib/active_record/explain.rb @@ -1,12 +1,10 @@ require 'active_support/lazy_load_hooks' module ActiveRecord - ActiveSupport.on_load(:active_record_config) do - mattr_accessor :auto_explain_threshold_in_seconds, instance_accessor: false - end - module Explain - delegate :auto_explain_threshold_in_seconds, :auto_explain_threshold_in_seconds=, to: 'ActiveRecord::Model' + def self.extended(base) + base.mattr_accessor :auto_explain_threshold_in_seconds, instance_accessor: false + end # If auto explain is enabled, this method triggers EXPLAIN logging for the # queries triggered by the block if it takes more than the threshold as a |