Skip to content

Commit 14d176f

Browse files
committed
Set User Class on Boot
For most of the Rails boot process, an app running solidus_auth_devise believes that its user class is whatever is configured in the config/spree.rb initializer. However, if `solidus_auth_devise` is installed, that is changed after most things have been configured. It need not be this way: If we want this gem to set a default, we should set it really early on, not in one of the last initializers to run (they also run alphabetically, so `solidus_auth_devise` initializers run quite late.
1 parent 6b31e00 commit 14d176f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/spree/auth/engine.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ class Engine < Rails::Engine
1313
isolate_namespace Spree
1414
engine_name 'solidus_auth'
1515

16+
Spree.user_class = "Spree::User"
17+
1618
initializer "spree.auth.environment", before: :load_config_initializers do |_app|
1719
require 'spree/auth_configuration'
1820

1921
Spree::Auth::Config = Spree::AuthConfiguration.new
2022
end
2123

22-
initializer "solidus_auth_devise.set_user_class", after: :load_config_initializers do
23-
Spree.user_class = "Spree::User"
24-
end
25-
2624
config.to_prepare do
2725
Spree::Auth::Engine.prepare_backend if SolidusSupport.backend_available?
2826
Spree::Auth::Engine.prepare_frontend if SolidusSupport.frontend_available?

0 commit comments

Comments
 (0)