edge badge
Namespace
Methods
C
Class Public methods
configurations()

Returns fully resolved configurations hash

# File activerecord/lib/active_record/core.rb, line 50
def self.configurations
  @@configurations
end
configurations=(config)

Contains the database configuration - as is typically stored in config/database.yml - as a Hash.

For example, the following database.yml…

development:
  adapter: sqlite3
  database: db/development.sqlite3

production:
  adapter: sqlite3
  database: db/production.sqlite3

…would result in ::configurations to look like this:

{
   'development' => {
      'adapter'  => 'sqlite3',
      'database' => 'db/development.sqlite3'
   },
   'production' => {
      'adapter'  => 'sqlite3',
      'database' => 'db/production.sqlite3'
   }
}
# File activerecord/lib/active_record/core.rb, line 44
def self.configurations=(config)
  @@configurations = ActiveRecord::ConnectionHandling::MergeAndResolveDefaultUrlConfig.new(config).resolve
end