Sha256: 97530da9c3298793462b86c101e1cda0bebe194004ba6b2bc18917cdd352d4c5

Contents?: true

Size: 754 Bytes

Versions: 73

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

require "active_support/per_thread_registry"

module ActiveRecord
  # This is a thread locals registry for Active Record. For example:
  #
  #   ActiveRecord::RuntimeRegistry.connection_handler
  #
  # returns the connection handler local to the current thread.
  #
  # See the documentation of ActiveSupport::PerThreadRegistry
  # for further details.
  class RuntimeRegistry # :nodoc:
    extend ActiveSupport::PerThreadRegistry

    attr_accessor :connection_handler, :sql_runtime

    [:connection_handler, :sql_runtime].each do |val|
      class_eval %{ def self.#{val}; instance.#{val}; end }, __FILE__, __LINE__
      class_eval %{ def self.#{val}=(x); instance.#{val}=x; end }, __FILE__, __LINE__
    end
  end
end

Version data entries

73 entries across 73 versions & 7 rubygems

Version Path
activerecord-6.0.6.1 lib/active_record/runtime_registry.rb
activerecord-6.0.6 lib/active_record/runtime_registry.rb
activerecord-6.0.5.1 lib/active_record/runtime_registry.rb
activerecord-5.2.8.1 lib/active_record/runtime_registry.rb
activerecord-5.2.8 lib/active_record/runtime_registry.rb
activerecord-6.0.5 lib/active_record/runtime_registry.rb
activerecord-6.0.4.8 lib/active_record/runtime_registry.rb
activerecord-5.2.7.1 lib/active_record/runtime_registry.rb
activerecord-5.2.7 lib/active_record/runtime_registry.rb
activerecord-6.0.4.7 lib/active_record/runtime_registry.rb
activerecord-5.2.6.3 lib/active_record/runtime_registry.rb
activerecord-6.0.4.6 lib/active_record/runtime_registry.rb
activerecord-5.2.6.2 lib/active_record/runtime_registry.rb
activerecord-5.2.6.1 lib/active_record/runtime_registry.rb
activerecord-6.0.4.5 lib/active_record/runtime_registry.rb
activerecord-6.0.4.4 lib/active_record/runtime_registry.rb
activerecord-6.0.4.3 lib/active_record/runtime_registry.rb
activerecord-6.0.4.2 lib/active_record/runtime_registry.rb
activerecord-6.0.4.1 lib/active_record/runtime_registry.rb
activerecord-6.0.4 lib/active_record/runtime_registry.rb