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 8 commits into
base: master
Choose a base branch
from
Draft

Upgrade to Rails 7.1 #7327

wants to merge 8 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

`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.
@jrmhaig jrmhaig force-pushed the rails_7_1 branch 2 times, most recently from 72846b5 to 537d87d Compare September 6, 2024 16:44
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.
Copy link

sonarqubecloud bot commented Sep 9, 2024

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