Sha256: b27344f2dbba35d1003de57011437fb82a4ce099038baf418c94f471ddcfdf1f

Contents?: true

Size: 661 Bytes

Versions: 2

Compression:

Stored size: 661 Bytes

Contents

module MongoSessionStore
  class Error < StandardError; end

  def self.collection_name
    @collection_name
  end

  def self.collection_name=(name)
    @collection_name = name

    if defined?(MongoidStore::Session)
      MongoidStore::Session.store_in \
        :collection => MongoSessionStore.collection_name
    end

    MongoStore::Session.reset_collection if defined?(MongoStore::Session)

    @collection_name
  end
end

if defined?(Mongoid)
  require "mongo_session_store/mongoid_store"
elsif defined?(Mongo)
  require "mongo_session_store/mongo_store"
end

# Default collection name for all the stores.
MongoSessionStore.collection_name = "sessions"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongo_session_store-3.2.1 lib/mongo_session_store.rb
mongo_session_store-3.2.0 lib/mongo_session_store.rb