instance method
default_hash
Ruby on Rails 6.0.6
Since v6.0.6 Last seen in v6.1.7.10Available in: v6.0.6 v6.1.7.10
Signature
default_hash(env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s)
Returns the config hash that corresponds with the environment
If the application has multiple databases default_hash will return the first config hash for the environment.
{ database: "my_db", adapter: "mysql2" }
Parameters
-
envopt = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s
Source
# File activerecord/lib/active_record/database_configurations.rb, line 62
def default_hash(env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s)
default = find_db_config(env)
default.config if default
end
Defined in activerecord/lib/active_record/database_configurations.rb line 62
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::DatabaseConfigurations