New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track the version-compatible config settings inside railties #28469

Merged
merged 1 commit into from Mar 18, 2017

Conversation

Projects
None yet
4 participants
@matthewd
Member

matthewd commented Mar 17, 2017

Instead of forcing new applications to carry an initializer that just switches things to what their default "should" be, we can handle it internally.

The initializer is then only used by upgraders: it shows what the new default would be (commented out), while their upgraded application continues to operate as it did before.

Under this model, a multiply-upgraded application could accumulate several new_framework_defaults_*.rb files, for each release series it has traversed. A given release series only needs to generate the latest, though, because we don't support rails app:upgrade while skipping releases.

Fixes #28291

Track the version-compatible config settings inside railties
Instead of forcing new applications to carry an initializer that just
switches things to what their default "should" be, we can handle it
internally.

The initializer is then only used by upgraders: it shows what the new
default would be (commented out), while their upgraded application
continues to operate as it did before.

Under this model, a multiply-upgraded application could accumulate
several new_framework_defaults_*.rb files, for each release series it
has traversed. A given release series only needs to generate the latest,
though, because we don't support `rails app:upgrade` while skipping
releases.
@kaspth

kaspth approved these changes Mar 17, 2017

Great! So existing 5.0 apps will just keep the new_framework_defaults in there with whatever their defaults were before the update?

@rafaelfranca rafaelfranca added this to the 5.1.0 milestone Mar 17, 2017

@maclover7 maclover7 added the railties label Mar 18, 2017

@matthewd matthewd merged commit 00c4a16 into rails:master Mar 18, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
codeclimate Code Climate is analyzing this code.
Details

y-yagi added a commit to y-yagi/rails that referenced this pull request Mar 19, 2017

Correctly check whether key is defined in configuration
It can not check correctly with `defined?`

```ruby
irb(main):001:0> Rails.application.config.active_record
=> {:maintain_test_schema=>true, :belongs_to_required_by_default=>true}
irb(main):002:0> defined?(Rails.application.config.active_record)
=> nil
```

Follow up to #28469

@matthewd matthewd deleted the matthewd:new-new-defaults branch Jun 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment