method
build_configs
v6.0.0 -
Show latest stable
-
0 notes -
Class: DatabaseConfigurations
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
build_configs(configs)
private
Hide source
# File activerecord/lib/active_record/database_configurations.rb, line 118 def build_configs(configs) return configs.configurations if configs.is_a?(DatabaseConfigurations) return configs if configs.is_a?(Array) db_configs = configs.flat_map do |env_name, config| if config.is_a?(Hash) && config.all? { |_, v| v.is_a?(Hash) } walk_configs(env_name.to_s, config) else build_db_config_from_raw_config(env_name.to_s, "primary", config) end end current_env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s unless db_configs.find(&:for_current_env?) db_configs << environment_url_config(current_env, "primary", {}) end merge_db_environment_variables(current_env, db_configs.compact) end