module ActiveRecord

Constants

MigrationProxy

MigrationProxy is used to defer loading of the actual migration classes until they are needed

Point
UnknownAttributeError

Raised when unknown attributes are supplied via mass assignment.

Attributes

application_record_class[RW]
async_query_executor[RW]
default_timezone[R]
index_nested_attribute_errors[RW]
lazily_load_schema_cache[RW]
legacy_connection_handling[RW]
maintain_test_schema[RW]
query_transformers[RW]
reading_role[RW]
schema_cache_ignored_tables[RW]
writing_role[RW]

Public Class Methods

default_timezone=(default_timezone) click to toggle source

Determines whether to use Time.utc (using :utc) or Time.local (using :local) when pulling dates and times from the database. This is set to :utc by default.

# File lib/active_record.rb, line 187
def self.default_timezone=(default_timezone)
  unless %i(local utc).include?(default_timezone)
    raise ArgumentError, "default_timezone must be either :utc (default) or :local."
  end

  @default_timezone = default_timezone
end
eager_load!() click to toggle source
Calls superclass method
# File lib/active_record.rb, line 343
def self.eager_load!
  super
  ActiveRecord::Locking.eager_load!
  ActiveRecord::Scoping.eager_load!
  ActiveRecord::Associations.eager_load!
  ActiveRecord::AttributeMethods.eager_load!
  ActiveRecord::ConnectionAdapters.eager_load!
  ActiveRecord::Encryption.eager_load!
end
gem_version() click to toggle source

Returns the version of the currently loaded Active Record as a Gem::Version

# File lib/active_record/gem_version.rb, line 5
def self.gem_version
  Gem::Version.new VERSION::STRING
end
global_executor_concurrency=(global_executor_concurrency) click to toggle source

Set the global_executor_concurrency. This configuration value can only be used with the global thread pool async query executor.

# File lib/active_record.rb, line 228
def self.global_executor_concurrency=(global_executor_concurrency)
  if self.async_query_executor.nil? || self.async_query_executor == :multi_thread_pool
    raise ArgumentError, "`global_executor_concurrency` cannot be set when using the executor is nil or set to multi_thead_pool. For multiple thread pools, please set the concurrency in your database configuration."
  end

  @global_executor_concurrency = global_executor_concurrency
end
unknown() click to toggle source

Specifies if the methods calling database queries should be logged below their relevant queries. Defaults to false.

# File lib/active_record.rb, line 248
singleton_class.attr_accessor :verbose_query_logs
version() click to toggle source

Returns the version of the currently loaded ActiveRecord as a Gem::Version

# File lib/active_record/version.rb, line 7
def self.version
  gem_version
end