brianhempel/mongo_session_store — Issue #9: Don't use autload to bring in different session stores
Author: mindscratch
Created: 2012-02-17 14:10:21+00:00
State: open

I just ran into an issue starting my JRuby on Rails app (which is deployed as a WAR file to a Tomcat server) that it couldn't load "mongo_mapper". This threw me for a minute b/c I use Mongoid and don't have any direct reference to mongo_mapper.

I found in [mongoid_session_store-rails3.rb](https://github.com/brianhempel/mongo_session_store/blob/master/lib/mongo_session_store-rails3.rb#L32) that autloading was being used (which was added as a pull request on issue #8).

The MongoSessionStore#collection_name= method ultimately ends up referencing the "MongoMapperStore" constant (defined by the autloading setup), which in turn ends up requring 'mongo_mapper', which I don't have installed.

I understand the autoload feature makes things a bit cleaner but it also causes things to break when you don't have all possibly used gems installed.