From 540bd060537d25763d5aa8843770843c633b6fbd Mon Sep 17 00:00:00 2001 From: Miguel Michelson Martinez Date: Wed, 22 Apr 2020 23:17:02 -0400 Subject: [PATCH] Update railtie.rb use after initialize to catch configuration from app initializer config --- lib/cypress_on_rails/railtie.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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