Sha256: b33acb4dda5d37f8f757655e1b49eb87341e5599e5d986b8ff189c089f669f8c

Contents?: true

Size: 638 Bytes

Versions: 112

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

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

112 entries across 112 versions & 10 rubygems

Version Path
activerecord-5.2.4.5 lib/active_record/explain_registry.rb
activerecord-6.1.2 lib/active_record/explain_registry.rb
activerecord-6.1.1 lib/active_record/explain_registry.rb
activerecord-6.1.0 lib/active_record/explain_registry.rb
activerecord-6.1.0.rc2 lib/active_record/explain_registry.rb
activerecord-6.1.0.rc1 lib/active_record/explain_registry.rb
activerecord-6.0.3.4 lib/active_record/explain_registry.rb
activerecord-5.2.4.4 lib/active_record/explain_registry.rb
activerecord-6.0.3.3 lib/active_record/explain_registry.rb
activerecord-6.0.3.2 lib/active_record/explain_registry.rb
activerecord-6.0.3.1 lib/active_record/explain_registry.rb
activerecord-5.2.4.3 lib/active_record/explain_registry.rb
activerecord-6.0.3 lib/active_record/explain_registry.rb
activerecord-6.0.3.rc1 lib/active_record/explain_registry.rb
activerecord-6.0.2.2 lib/active_record/explain_registry.rb
activerecord-5.2.4.2 lib/active_record/explain_registry.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/explain_registry.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/explain_registry.rb
activerecord-6.0.2.1 lib/active_record/explain_registry.rb
activerecord-5.2.4.1 lib/active_record/explain_registry.rb