REPL example:
>> @current_user
=> #<User id: 1, .... >
>> current_user
=> nil
The current_user method just sets @current_user. But what bothers me more is if I add the following code to a rails controller action:
Better errors shows:
RuntimeError at /
{"_csrf_token"=>"LZVL/M2eXukjsNYW2fvgaZaGFgXzAc+TReXv4JQXqRY=", "user_id"=>1, "flash"=>#<ActionDispatch::Flash::FlashHash:0x007f613e078d10 @used=#<Set: {:notice}>, @closed=false, @Flashes={:notice=>"Logged in!"}, @now=nil>}
However, in the REPL:
Which would seem to make sense why at least my current_user method returns nil.
This is in a Rails 3.2 app, but even as I am upgrading to 4.1, I am getting the same behavior. I am methodically going through my dependencies, but any pointers would be appreciated!
I have skimmed the issues and none seem to match, please redirect me if I missed something!