Class: ActiveRecord::ExplainRegistry
- Extended by:
- ActiveSupport::PerThreadRegistry
- Defined in:
- activerecord/lib/active_record/explain_registry.rb
Overview
This is a thread locals registry for EXPLAIN. For example
ActiveRecord::ExplainRegistry.queries
returns the collected queries local to the current thread.
See the documentation of ActiveSupport::PerThreadRegistry for further details.
Instance Attribute Summary collapse
-
#collect ⇒ Object
Returns the value of attribute collect.
-
#queries ⇒ Object
Returns the value of attribute queries.
Instance Method Summary collapse
- #collect? ⇒ Boolean
-
#initialize ⇒ ExplainRegistry
constructor
A new instance of ExplainRegistry.
- #reset ⇒ Object
Methods included from ActiveSupport::PerThreadRegistry
Constructor Details
#initialize ⇒ ExplainRegistry
Returns a new instance of ExplainRegistry.
19 20 21 |
# File 'activerecord/lib/active_record/explain_registry.rb', line 19 def initialize reset end |
Instance Attribute Details
#collect ⇒ Object
Returns the value of attribute collect
17 18 19 |
# File 'activerecord/lib/active_record/explain_registry.rb', line 17 def collect @collect end |
#queries ⇒ Object
Returns the value of attribute queries
17 18 19 |
# File 'activerecord/lib/active_record/explain_registry.rb', line 17 def queries @queries end |
Instance Method Details
#collect? ⇒ Boolean
23 24 25 |
# File 'activerecord/lib/active_record/explain_registry.rb', line 23 def collect? @collect end |
#reset ⇒ Object
27 28 29 30 |
# File 'activerecord/lib/active_record/explain_registry.rb', line 27 def reset @collect = false @queries = [] end |