diff --git a/lib/cypress_on_rails/railtie.rb b/lib/cypress_on_rails/railtie.rb index 530ee29..229225d 100644 --- a/lib/cypress_on_rails/railtie.rb +++ b/lib/cypress_on_rails/railtie.rb @@ -4,10 +4,10 @@ module CypressOnRails class Railtie < Rails::Railtie - initializer :setup_cypress_middleware do |app| - if CypressOnRails.configuration.use_middleware? - app.middleware.use Middleware - end - end + config.after_initialize do |app| + if CypressOnRails.configuration.use_middleware? + app.middleware.use Middleware + end + end end end