Created
February 26, 2012 16:56
-
-
Save anonymous/1917678 to your computer and use it in GitHub Desktop.
JRuby Monkey patch gist 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MongoSessionStore | |
def self.collection_name=(name) | |
@collection_name = name | |
if defined?(MongoStore::Session) | |
MongoStore::Session.reset_collection | |
end | |
if defined?(MongoMapperStore::Session) | |
MongoMapperStore::Session.set_collection_name(name) | |
end | |
if defined?(MongoidStore::Session) | |
MongoidStore::Session.store_in(name) | |
end | |
end | |
# default collection name for all the stores | |
self.collection_name = "sessions" | |
end | |
autoload :MongoMapperStore, 'mongo_session_store/mongo_mapper_store' | |
autoload :MongoidStore, 'mongo_session_store/mongoid_store' | |
autoload :MongoStore, 'mongo_session_store/mongo_store' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment