Skip to content

Track the version-compatible config settings inside railties#28469

Merged
matthewd merged 1 commit intorails:masterfrom
matthewd:new-new-defaults
Mar 18, 2017
Merged

Track the version-compatible config settings inside railties#28469
matthewd merged 1 commit intorails:masterfrom
matthewd:new-new-defaults

Conversation

@matthewd
Copy link
Member

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

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.
Copy link
Contributor

@kaspth kaspth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@matthewd matthewd merged commit 00c4a16 into rails:master Mar 18, 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
@matthewd matthewd deleted the new-new-defaults branch June 11, 2017 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants