Fix For Password Archival And Expiration After rails-7 Upgrade #8
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.
Jira: VP-2057
Important
Toggle to Squash and Merge when merging PRs to
stagingbranchWhat
is_a?(TrueClass)is not a reliable way to check for true. It caused logic to fail in Rails 7 that used to work in Rails 5.expire_password_afteris usually a duration like 365.days, which isn’t a number. Rails 5 handled this loosely, but Rails 7 is stricter. Checking withrespond_to?(:ago)ensures it behaves like a duration.Testing
I tested this code by (unit/integration/manual) testing…
Extras
bin/build,.envchanges etc.(if any are checked, please describe below)
PR Code Coverage
Measure with
bin/test_covor some other means. You can find html coverage levels incoverage/index.htmlor instdout.After a successful test run, you can also see calculated and merged coverage, per branch, on Grafana