instance method connection_db_config

Ruby on Rails 7.0.10

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

connection_db_config()

Returns the db_config object from the associated connection:

ActiveRecord::Base.connection_db_config
  #<ActiveRecord::DatabaseConfigurations::HashConfig:0x00007fd1acbded10 @env_name="development",
    @name="primary", @config={pool: 5, timeout: 5000, database: "db/development.sqlite3", adapter: "sqlite3"}>

Use only for reading.

Source
# File activerecord/lib/active_record/connection_handling.rb, line 304
    def connection_db_config
      connection_pool.db_config
    end

Defined in activerecord/lib/active_record/connection_handling.rb line 304 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionHandling

Type at least 2 characters to search.

↑↓ navigate · open · esc close