Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2582

__session__ returns Sessions.with_name(nil) instead of default session

      I have barebones rails 3.2.9 app with mongoid 3.0.14. I am using a pristine mongoid.yml straight from the generator. When I try to access any models, I get the error message:

      Problem:
        No configuration could be found for a session named ''.
      Summary:
        When attempting to create the new session, Mongoid could not find a session configuration for the name: ''. This is necessary in order to know the host, port, and options needed to connect.
      

      I have confirmed that my Rails ENV is properly set to development and that the yaml file is being parsed correctly. Using the debugger, I have traced the issue to the session method in sessions.rb. For some inexplicable reason, despite session_override returning nil (which it should), the first code path is still executed, and Sessions.with_name(nil) is called, instead of Sessions.default. See this gist:
      https://gist.github.com/4148114

      This issue occurs when I am not using the debugger, so I don't think its a heisenbug. Any help is appreciated.

            Assignee:
            Unassigned Unassigned
            Reporter:
            emkman emkman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: