Skip to content
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

Prep rails upgrades #8528

Merged
merged 14 commits into from
Jan 13, 2025
Merged

Prep rails upgrades #8528

merged 14 commits into from
Jan 13, 2025

Conversation

gbp
Copy link
Member

@gbp gbp commented Jan 13, 2025

Relevant issue(s)

#8515 #8517 #8527

What does this do?

Minor changes needed to make the upgrade from Rails 7.0 to 8.0 smoother.

[skip changelog]

gbp added 13 commits January 13, 2025 10:22
Ignore files and directories which either have unusal inflections or
can't be autoloaded by Zeitwerk.

In the upcoming Rails upgrades Zeitwerk will attempt to load everything
in lib at boot so we need to add these exceptions.
This fixes an exception in Rails 7.1 when using fixture sets:
  NameError: uninitialized constant ActiveRecord::FixtureSet::ClassCache
In Rails 7.1 it will require a default ActiveStorage service to be
defined.

This adds a service for the test environment so test examples
don't break when we bump the Rails gem.

This commit ensures the tests can be run on future bump commit. The
other environments will be defined when we run `rails app:update`.
When migrating a new database under Rails 7.1 this migration breaks due
to a new constraint ensuring enums have a database backed column.

Our `Note#style` was added in a later migration so doesn't exist yet.
Recreating the Note class without the enum defined allows full migration
to succeed.
Ensure we are matching strings with strings. In Rails 7.1 this will
return an `ActionView::OutputBuffer`.
Once `action_controller.raise_on_missing_callback_actions` is enabled we
will see exceptions due to the `signin` action not existing.
Sometimes we need locales to be loaded before the application has been
initialised.

Setting in the in `config.before_configuration` block doesn't persist
correctly and also needs to be called in after initialisation.

This issue becomes apparent when there is an exception at boot.

The error message might call `to_sentence` [1], which will attempt to
load a translation and this then error if `set_locales` hasn't been
called.

[1]: https://github.com/rails/rails/blob/d39db5d/activestorage/lib/active_storage/service/registry.rb#L18-L19

See #5382
Ensure data can be retrieved via symbol keys. When enabling the Rails
7.1 framework default data will be returned with string keys.
So these helpers are available to files which aren't loaded via
Zeitwerk such as the poller and text masker.
This config has changed in Rails 7.1 to allow multiple paths to be
defined.
Fixes `PG::SyntaxError` exception when upgrading to Rails 7.2.
In Rails 8 you have to set `active_job.queue_adapter`. This change sets
it back to the default value in Rails 7.x.
Rails 8 adds additional route validation so this raise an exception.
Switch to positional arguments instead of keyword arguments. This fixes
deprecation warning when upgrading to Rails 7.2.
@gbp gbp merged commit 73ae2d6 into develop Jan 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant