instance method
default_hash
Ruby on Rails 6.1.7.10
Since v6.0.6 Last seen in v6.1.7.10Available in: v6.0.6 v6.1.7.10
Signature
default_hash(env = default_env)
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 = default_env
Source
# File activerecord/lib/active_record/database_configurations.rb, line 71
def default_hash(env = default_env)
default = find_db_config(env)
default.configuration_hash if default
end
Defined in activerecord/lib/active_record/database_configurations.rb line 71
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::DatabaseConfigurations