Sha256: c86283e83db8fb2b67bed153efb26a9ef7ad996647ef23839c6518015edef0a0

Contents?: true

Size: 607 Bytes

Versions: 35

Compression:

Stored size: 607 Bytes

Contents

require 'active_support/per_thread_registry'

module ActiveRecord
  # 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.
  class ExplainRegistry # :nodoc:
    extend ActiveSupport::PerThreadRegistry

    attr_accessor :queries, :collect

    def initialize
      reset
    end

    def collect?
      @collect
    end

    def reset
      @collect = false
      @queries = []
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
activerecord-5.0.7.2 lib/active_record/explain_registry.rb
activerecord-5.0.7.1 lib/active_record/explain_registry.rb
activerecord-5.0.7 lib/active_record/explain_registry.rb
activerecord-5.0.6 lib/active_record/explain_registry.rb
activerecord-5.0.6.rc1 lib/active_record/explain_registry.rb
activerecord-5.0.5 lib/active_record/explain_registry.rb
activerecord-5.0.5.rc2 lib/active_record/explain_registry.rb
activerecord-5.0.5.rc1 lib/active_record/explain_registry.rb
activerecord-5.0.4 lib/active_record/explain_registry.rb
activerecord-5.0.4.rc1 lib/active_record/explain_registry.rb
activerecord-5.0.3 lib/active_record/explain_registry.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-5.0.2/lib/active_record/explain_registry.rb
activerecord-5.0.2 lib/active_record/explain_registry.rb
activerecord-5.0.2.rc1 lib/active_record/explain_registry.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/explain_registry.rb