Class: ActiveRecord::ExplainRegistry
- Inherits:
-
Object
- Object
- ActiveRecord::ExplainRegistry
- Extended by:
- ActiveSupport::PerThreadRegistry
- Defined in:
- 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
Constructor Details
#initialize ⇒ ExplainRegistry
Returns a new instance of ExplainRegistry.
17 18 19 |
# File 'lib/active_record/explain_registry.rb', line 17 def initialize reset end |
Instance Attribute Details
#collect ⇒ Object
Returns the value of attribute collect.
15 16 17 |
# File 'lib/active_record/explain_registry.rb', line 15 def collect @collect end |
#queries ⇒ Object
Returns the value of attribute queries.
15 16 17 |
# File 'lib/active_record/explain_registry.rb', line 15 def queries @queries end |
Instance Method Details
#collect? ⇒ Boolean
21 22 23 |
# File 'lib/active_record/explain_registry.rb', line 21 def collect? @collect end |
#reset ⇒ Object
25 26 27 28 |
# File 'lib/active_record/explain_registry.rb', line 25 def reset @collect = false @queries = [] end |