Open
Description
Hey,
Albeit the mention of setting the base controller, I was trying to define a contraint while mounting the engine.
mount MissionControl::Jobs::Engine, at: "jobs", constraints: AdminConstraint.new
class AdminConstraint
def matches?(request)
return unless request.session[:user_id]
User.find(request.session[:user_id])&.admin?
end
end
which fails because <ActionDispatch::Request::Session:0x72ba0 not yet loaded>
I don't know if it's a limit of Rails engine (it used to work with Sidekiq dashboard though) or if there is some loading logic to change to make it work. Is that something that can be envisioned? Thanks
Metadata
Metadata
Assignees
Labels
No labels