Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9154 +/- ##
=======================================
Coverage 99.11% 99.12%
=======================================
Files 139 139
Lines 4071 4092 +21
=======================================
+ Hits 4035 4056 +21
Misses 36 36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
17 of 22 tasks
Contributor
Author
|
Codecov's missing line was the A review pass also found two bugs in the sign-out override, both now fixed with specs:
The docs now say that host-app route helpers need |
Route helpers always came from Rails.application.routes, so an app that calls ActiveAdmin.routes inside an engine's routes.draw had to include the engine's url_helpers into ActiveAdmin internals (activeadmin#4294). Devise lookups go through router_name, so the Devise views use Devise's path helpers and sign-out uses ActiveAdmin's root_path. Co-Authored-By: Clanker
ActiveAdmin's sign-out override sat ahead of ApplicationController and ignored an app's own redirect. It now applies only when Devise's default would run. Co-Authored-By: Clanker
A subclass that overrides after_sign_out_path_for and calls super made method() resolve to the subclass, so the engine root was skipped. The docs now say host-app helpers need main_app in the engine setup. Co-Authored-By: Clanker
senid231
force-pushed
the
route-helpers-engine
branch
from
November 12, 2026 11:20
5b5d26d to
30f4c3e
Compare
The spec drew routes for a temporary application and left them in place, so a later spec that expected the admin routes could fail. Co-Authored-By: Clanker
Co-Authored-By: Clanker
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Active Admin now builds its route helpers from the route set that
ActiveAdmin.routes(self)is called in, so it works inside an engine'sroutes.draw. Until now, apps patchedHelpers::Routes,BaseControllerand the Devise controllers to get there (#4294).Decisions the diff doesn't show:
ActionDispatch::Routing::Mapperhas no public reader for its route set in Rails 7.2 to 8.1, soApplication#routesreads@set, falling back to the host routes. A spec fails if that breaks.BaseController.inheritedadds the engine's helpers to resource and page controllers. If controllers were loaded for another route set,ActiveAdmin.routesreloads them, so only one route set can host Active Admin. In an engine app on Rails 7.2 and 8.1, the engine's routes trigger the first load, so Active Admin and itsbefore_loadandafter_loadhooks still run once. A second load happens only if something loads Active Admin earlier, such as callingActiveAdmin.routesin both the host and the engine.router_name. Withrouter_name, Devise looks uproot_pathon that route set after sign-out, so Active Admin returns its own root there. An app'safter_sign_out_path_forstill wins. Apps withrouter_name: :main_appnow sign out to the admin root, as apps without it already did.main_app.. The docs say so.Part of #9147. Request specs mount an engine at
/backofficeand cover pages, sign-in and sign-out.