Sha256: ad55dfbeb657ce7c039ee7138f20849547922794c6dd7f366bfc41b31789d9b3

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

require 'dm-core'
require 'rack_datamapper/session/datamapper'
require 'active_support'

module ActionController
  module Session
    class DatamapperStore < AbstractStore

      def initialize(app, options = {})
        super
        id_generator = Proc.new do
          ::ActiveSupport::SecureRandom.hex(16)
        end
        @store = ::DataMapper::Session::Abstract::Store.new(app, options, id_generator)
        @options = options
      end

      private
      def get_session(env, sid)
        @store.get_session(env, sid)
      end

      def set_session(env, sid, session_data)
        @store.set_session(env, sid, session_data, @options)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datamapper4rails-0.4.0 lib/datamapper4rails/datamapper_store.rb
datamapper4rails-0.3.2 lib/datamapper4rails/datamapper_store.rb
datamapper4rails-0.3.1 lib/datamapper4rails/datamapper_store.rb
datamapper4rails-0.3.0 lib/datamapper4rails/datamapper_store.rb