Permalink
Browse files

auto_explain_threshold_in_seconds should be a global config option so…

… it can be shared between AR::Base and AR::Model
  • Loading branch information...
jonleighton committed Dec 24, 2011
1 parent 13945b0 commit 15fbf5b58be386c8c5c02b06a4069c23cbcd5f0f
Showing with 3 additions and 8 deletions.
  1. +3 −8 activerecord/lib/active_record/explain.rb
@@ -2,14 +2,9 @@
module ActiveRecord
module Explain
- def self.extended(base)
- base.class_eval do
- # If a query takes longer than these many seconds we log its query plan
- # automatically. nil disables this feature.
- class_attribute :auto_explain_threshold_in_seconds, :instance_writer => false
- self.auto_explain_threshold_in_seconds = nil
- end
- end
+ # If a query takes longer than these many seconds we log its query plan
+ # automatically. nil disables this feature.
+ Configuration.define :auto_explain_threshold_in_seconds
# 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

0 comments on commit 15fbf5b

Please sign in to comment.