Devise: undefined method `user_signed_in?' for ApplicationController:Class-Collection of common programming errors

So I’m marking this as a community wiki since the solution is trivial.

I was calling debugger (which I used to check current_user with the following code

class ApplicationController < ActionController::Base
  protect_from_forgery
  debugger
  filter {|c| Authorization.current_user = c.current_user}
end

Rails makes the session and request objects available to instances of controllers. That debugger is called in the context of self == ApplicationController when it should be self == #.

Long story short, make sure you’re not trying to call it within a controller definition but within the controller instance.

Originally posted 2013-11-09 20:53:41.