1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
eileencodes 4a68792df7 Fix database.yml merging
Ok so apparently you can not just have a `default:` that manually is
merged in with YAML but you can also have a special "shared" config that
is automatically merged.

Example:

```
shared:
  adapter: mysql2
  host: <%= ENV["DB_HOST"] || "localhost" %>
  username: root
  connect_timeout: 0
  pool: 100
  reconnect: true

development:
  database: development_db
  adapter: mysql2
```

To fix, only create a DatabaseConfig object when an adapter, database,
or URL are present.

The merging behavior for `shared` doesn't work with a 3-tier config. I
don't think it worked before this change either - since Rails doesn't
know which point to merge it in. That's something we may have to fix
with the refactoring I'm working on.
2018-04-12 16:40:35 -04:00
..
active_record Fix database.yml merging 2018-04-12 16:40:35 -04:00
rails/generators Rails 6 requires Ruby 2.3+ 2018-02-17 10:03:37 -08:00
active_record.rb Remove ForeignKeys module which was introduced at #32299 2018-04-02 17:54:26 +09:00