diff --git a/lib/sorcery/engine.rb b/lib/sorcery/engine.rb index 8042cf9a..77be7648 100644 --- a/lib/sorcery/engine.rb +++ b/lib/sorcery/engine.rb @@ -8,9 +8,11 @@ class Engine < Rails::Engine config.sorcery = ::Sorcery::Controller::Config initializer 'extend Controller with sorcery' do - ActionController::Base.send(:include, Sorcery::Controller) - ActionController::Base.helper_method :current_user - ActionController::Base.helper_method :logged_in? + ActiveSupport.on_load('action_controller') do + send(:include, Sorcery::Controller) + helper_method :current_user + helper_method :logged_in? + end end end end