Use Rails load_defaults
for relevant gemfile in test runs
#473
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.
All non-EOL'd Rails version at this point support a
load_defaults
method which can be used to tell Rails which version defaults to start with.Some of the rails-version-gemfile test runs currently have deprecations about options that are either changing or going away or whatever, but these can generally be silenced by telling a given version to use it's own defaults, which is what this PR does.
Example of warning: https://github.com/ElMassimo/vite_ruby/actions/runs/9424262054/job/25964175006#step:6:9
The one oddity here (explained with inline comment in the diff) is the behavior of
media: screen
. In versions prior to 7.0, themedia
attribute in stylesheet tags would default toscreen
. That was changed in 7.0 to not be there by default, a behvaior which has a config option to enable/disable - rails/rails@1280620I've chosen here to do the smallest diff approach - which is to just enable the option, which keeps the
link
method helper in helper_test working as-is (has a default media attribute). Another approach would be to leave the default off, and then modify that helper to default to no media, and only add one if passed in.