lib/switch_user/provider/devise.rb in switch_user-0.9.1 vs lib/switch_user/provider/devise.rb in switch_user-0.9.2
- old
+ new
@@ -1,7 +1,5 @@
-require 'switch_user/provider/base'
-
module SwitchUser
module Provider
class Devise < Base
def initialize(controller)
@controller = controller
@@ -15,10 +13,10 @@
def logout(scope = :user)
@warden.logout(scope)
end
def current_user(scope = :user)
- @controller.send("current_#{scope}")
+ @warden.user(scope)
end
end
end
end