Skip to content

Commit

Permalink
Merge pull request #69 from tvdeyen/use-user_class_name
Browse files Browse the repository at this point in the history
Use Alchemy.user_class_name
  • Loading branch information
tvdeyen authored Oct 21, 2020
2 parents 50fb130 + 4f7a277 commit e85b6b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/alchemy/solidus/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class Engine < ::Rails::Engine
Alchemy.register_ability ::Spree::Ability
::Spree::Ability.register_ability ::Alchemy::Permissions

if Alchemy.user_class.name == 'Spree::User'
if Alchemy.user_class_name == '::Spree::User'
require 'alchemy/solidus/spree_user_extension'
Spree::User.include Alchemy::Solidus::SpreeUserExtension
end

if Alchemy.user_class.name == 'Alchemy::User'
if Alchemy.user_class_name == '::Alchemy::User'
require 'alchemy/solidus/alchemy_user_extension'
Alchemy::User.include Alchemy::Solidus::AlchemyUserExtension
require 'alchemy/solidus/spree_admin_unauthorized_redirect'
Expand All @@ -40,7 +40,7 @@ class Engine < ::Rails::Engine
# Fix for +belongs_to :bill_address+ in {Spree::UserAddressBook}
# Solidus has this set to +false+ in {Spree::Base}, but {Alchemy::User} does not inherit from it.
initializer 'alchemy_solidus.belongs_bill_address_fix' do
if Alchemy.user_class.name == 'Alchemy::User'
if Alchemy.user_class_name == '::Alchemy::User'
ActiveSupport.on_load(:active_record) do
Alchemy::User.belongs_to_required_by_default = false
end
Expand Down

0 comments on commit e85b6b9

Please sign in to comment.