Skip to content

Instance variables are accessible, but method invocation seems to fail #250

@nearapogee

Description

@nearapogee

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:

raise session.inspect

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:

>> session
=> {}

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions