Skip to content

LT-53534: support Rails 8 and Devise 5 from v2.2.0 - #2

Merged
relsett merged 3 commits into
leveltravel-v2.2.0from
feature/LT-53534-v2.2.0-rails-8-compatibility
Aug 25, 2026
Merged

LT-53534: support Rails 8 and Devise 5 from v2.2.0#2
relsett merged 3 commits into
leveltravel-v2.2.0from
feature/LT-53534-v2.2.0-rails-8-compatibility

Conversation

@relsett

@relsett relsett commented Aug 24, 2026

Copy link
Copy Markdown

База

Ветка построена от точного upstream tag v2.2.0, который использует leveltravel. Post-release изменения upstream/master не входят.

Runtime

Из upstream PR #219 взяты только три совместимые правки с сохранением авторства:

  • update_attributes заменён на update;
  • TOTP timestamp сохраняется как UTC Time;
  • resend_code остаётся collection route и исключён из списка resource actions.

Runtime diff затрагивает два файла гема.

Test-only

  • regression на encrypted secret → успешный TOTP → persist/reload → запрет replay;
  • regression на resend_code route;
  • точные selectors для Devise и ROTP;
  • минимальная совместимость старого dummy-app с Rails 8/Ruby 3.4.

Dummy-app больше не поднимает неиспользуемый asset pipeline. В PR нет workflow, manifest, новых ассетов, monkey patch, удаления Travis или legacy dependency matrix.

Проверка

Локально на Ruby 3.4.10 и ROTP 6.2.0:

  • Rails 8.0.5.1 × Devise 4.9.4 / 5.0.4 — 81 example, 0 failures;
  • Rails 8.1.3.1 × Devise 4.9.4 / 5.0.4 — 81 example, 0 failures;
  • независимое read-only review — PASS.

После merge leveltravel PR #26241 будет закреплён на exact SHA этого PR; application monkey patch там удалён.

willnet and others added 3 commits August 24, 2026 20:03
Rails 7 removes Active Record's deprecated update_attributes method. Direct OTP issuance and cleanup would therefore fail before an authentication flow could complete.

Switch these calls to update and rename the non-persisted GuestUser test double's matching method so the test harness continues to mirror the production interface.
With the newer ROTP versions required by the Rails 8 matrix, verification returns a Unix timestamp while the persisted column expects a datetime. Convert it explicitly to UTC Time before assignment.

Rails 8 also validates the resource action list strictly: resend_code is declared as a separate collection route and must not be listed as a resource action. Keep that endpoint while limiting the resource actions to show and update.
@relsett
relsett force-pushed the feature/LT-53534-v2.2.0-rails-8-compatibility branch from 2412113 to 6fac7ac Compare August 24, 2026 17:25
@relsett
relsett merged commit cf76558 into leveltravel-v2.2.0 Aug 25, 2026
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.

2 participants