Class: Supabase::Rails::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/supabase/rails/engine.rb

Overview

Internal ‘::Rails::Engine` (FR-W8 / US-017). Its only job is to add the gem’s top-level ‘app/controllers`, `app/views`, and `config/locales` directories to the host app’s autoload + I18n load paths. It is NOT mounted by users — there’s no ‘mount Supabase::Rails::Engine`. Routes for the auth surface come from the `supabase_authentication_routes` helper (FR-W12 / US-022) that the install generator emits into the host’s ‘config/routes.rb`.

We deliberately do NOT call ‘isolate_namespace` so that the gem’s controllers inherit from the host’s ‘::ApplicationController` (picking up CSRF, layouts, helpers, and any global before_actions) and so the views resolve under the host’s view-path lookup rules.

‘Engine.root` is left at the framework default — Rails walks up from this file until it finds the gem root (the directory containing `lib/supabase/rails.rb`), which is exactly what we want.