Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user_class#name #60

Merged
merged 2 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
redirect_to spree.root_path
else
store_location
redirect_to alchemy.login_path
redirect_to Alchemy.login_path
end
end