Sha256: 001b770e045e498f260e66b5a8d24327e7c1a7b70d98bb034490752e7eee0755

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

require 'warden'
require 'martinet/active_record_serializer'

module Martinet
  class Railtie < Rails::Railtie
    # TODO: Test me
    initializer 'martinet.setup_warden-manager' do |app|
      app.middleware.use Warden::Manager do |config|
        config.serialize_into_session do |user|
          ActiveRecordSerializer.serialize(record: user)
        end

        config.serialize_from_session do |object_hash|
          ActiveRecordSerializer.deserialize(object_hash: object_hash)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
martinet-0.0.3 lib/martinet/railtie.rb
martinet-0.0.2 lib/martinet/railtie.rb