From 0ca71ce0a950a2eb2041624deb3d84bba1a1aac7 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 3 Sep 2020 18:27:48 +0100 Subject: [PATCH] Do not reload routes and make spree routes append instead of draw in case thee routes are already defined elsewhere, for example, by the paypal express gem --- config/application.rb | 6 ------ config/routes/spree.rb | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/config/application.rb b/config/application.rb index 0e7cf2089a..b1feaa4400 100644 --- a/config/application.rb +++ b/config/application.rb @@ -33,12 +33,6 @@ module Openfoodnetwork end end - # We reload the routes here - # so that the appended/prepended routes are available to the application. - config.after_initialize do - Rails.application.routes_reloader.reload! - end - initializer "spree.environment", before: :load_config_initializers do |app| app.config.spree = Spree::Core::Environment.new Spree::Config = app.config.spree.preferences # legacy access diff --git a/config/routes/spree.rb b/config/routes/spree.rb index cb35c08cbc..9b176b652a 100644 --- a/config/routes/spree.rb +++ b/config/routes/spree.rb @@ -1,5 +1,4 @@ -# Overriding Devise routes to use our own controller -Spree::Core::Engine.routes.draw do +Spree::Core::Engine.routes.append do devise_for :spree_user, :class_name => 'Spree::User', :controllers => { :sessions => 'spree/user_sessions',