Sha256: aecd644bd88c2446685eaefcd6113821bae564c9f30822f9274caff299a61511

Contents?: true

Size: 802 Bytes

Versions: 2

Compression:

Stored size: 802 Bytes

Contents

require 'securerandom'

$:.unshift File.dirname(__FILE__)

module MongoSessionStore
  autoload :VERSION, 'mongo_session_store/version'

  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

    @collection_name
  end

  def self.collection_name
    @collection_name 
  end
  
  # default collection name for all the stores
  self.collection_name = "sessions"
end

require 'mongo_session_store/mongo_mapper_store'
require 'mongo_session_store/mongoid_store'
require 'mongo_session_store/mongo_store'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongo_session_store-rails3-3.0.6 lib/mongo_session_store-rails3.rb
mongo_session_store-rails3-3.0.5 lib/mongo_session_store-rails3.rb