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

Upgrade to Rails 7.1 #7327

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Upgrade to Rails 7.1 #7327

wants to merge 14 commits into from

Conversation

jrmhaig
Copy link
Contributor

@jrmhaig jrmhaig commented Aug 23, 2024

config.load_defaults is set to 7.0 and upgrading tasks have not been done yet

What

Ticket

board ticket description

Why

How


TODO (wip)

  • item 1
  • item 2

@jrmhaig jrmhaig force-pushed the rails_7_1 branch 4 times, most recently from 537d87d to 5afac4c Compare September 6, 2024 17:30
Copy link

sonarqubecloud bot commented Sep 9, 2024

@jrmhaig jrmhaig force-pushed the rails_7_1 branch 3 times, most recently from 573a6f5 to 94d12e1 Compare January 9, 2025 15:40
`config.load_defaults` is set to 7.0 and upgrading tasks have not been done yet
With Rails 7.1 `helper.govuk_warning_text_description` is returning an instance
of ActionView::OutputBuffer instead of implicitly converting to a string. This
was causing an error in the test.
Raising for missing callback actions is a new default in Rails 7.1. Therefore
a callback that is defined by an extended concern will cause a failure if the
action is not defined. The `regenerate_api_key` only exists for external user
admin so the callback needs to be moved from the concern to the controller.
Fix for deprecation warning:

> DEPRECATION WARNING: Passing the class as positional argument is deprecated and will be removed in Rails 7.2.
The PasswordHelpers mixin is split into to parts:

* PasswordHelpers contains helpers for updating user password
* UserAdminHelpers includes helpers for creating new users

Rails 7.1 by default raises exceptions when attempting to create callback for
actions that do not exist. This caused exceptions with SuperAdminController,
which does not have the `create` action for creating new users.
In Rails 7.1 the `sum` method no longer overrides `Enumerable#sum`. One change
is that there is no implicit conversion of nil to integer. When a fee is
cleared with `Fee::BaseFee#clear` the amount is set to nil and so
claim.basic_fees.sum(&:amount) fails.

It might be appropriate to change `Fee::BaseFee#clear` so that the values
are set to zero instead of nil. However, this may have other side-effects.
After upgrading to Rails 7.1 there were persistent 'stack level too deep' with
some partials. This was traced back to:

  https://github.com/rails/rails/blob/fa9cf269191c5077de1abdd1e3f934fbeaf2a5d0/activesupport/lib/active_support/core_ext/object/json.rb#L58-L66

Changing this monkey patch slightly prevents the errors. Ideally, this will be
removed when a better solution is found.

See: rails/rails#51626
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