Track the version-compatible config settings inside railties#28469
Merged
matthewd merged 1 commit intorails:masterfrom Mar 18, 2017
Merged
Track the version-compatible config settings inside railties#28469matthewd merged 1 commit intorails:masterfrom
matthewd merged 1 commit intorails:masterfrom
Conversation
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
approved these changes
Mar 17, 2017
Contributor
kaspth
left a comment
There was a problem hiding this comment.
Great! So existing 5.0 apps will just keep the new_framework_defaults in there with whatever their defaults were before the update?
rafaelfranca
approved these changes
Mar 17, 2017
y-yagi
added a commit
to y-yagi/rails
that referenced
this pull request
Mar 19, 2017
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 rails#28469
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_*.rbfiles, for each release series it has traversed. A given release series only needs to generate the latest, though, because we don't supportrails app:upgradewhile skipping releases.Fixes #28291