Skip to content

Commit

Permalink
Fix rails injection (#150)
Browse files Browse the repository at this point in the history
* fix rails injection

* only add helper_methods to ActionController::Base
  • Loading branch information
tiii authored and Ch4s3 committed Oct 15, 2018
1 parent ee532c1 commit e3045a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sorcery/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class Engine < Rails::Engine
config.sorcery = ::Sorcery::Controller::Config

initializer 'extend Controller with sorcery' do
ActiveSupport.on_load('action_controller') do
ActiveSupport.on_load(:action_controller) do
send(:include, Sorcery::Controller)
end
ActiveSupport.on_load(:action_controller_base) do
helper_method :current_user
helper_method :logged_in?
end
Expand Down

0 comments on commit e3045a9

Please sign in to comment.