Revert "Do not reload routes and make spree routes append instead of draw in"

This reverts commit cdf4c795c7c7ae18006eb24af9336941361b6b81.
This commit is contained in:
Luis Ramos
2020-10-27 13:35:45 +00:00
parent eada388534
commit 8f2d52b9e3
2 changed files with 8 additions and 1 deletions

View File

@@ -28,6 +28,12 @@ module Openfoodnetwork
Spree::Core::Engine.routes.default_url_options[:host] = 'test.host' if Rails.env = 'test'
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

View File

@@ -1,4 +1,5 @@
Spree::Core::Engine.routes.append do
# Overriding Devise routes to use our own controller
Spree::Core::Engine.routes.draw do
devise_for :spree_user,
:class_name => 'Spree::User',
:controllers => { :sessions => 'spree/user_sessions',