public
anonymous / gist:1917678
Created

JRuby Monkey patch gist 1

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.