class TrailGuide::Adapters::Participants::Redis

Public Class Methods

new() { |config| ... } click to toggle source
# File lib/trail_guide/adapters/participants/redis.rb, line 6
def initialize(&block)
  configure do |config|
    config.namespace = :participants
    # TODO this can be simplified now that adapters have a contextual subject
    config.lookup = -> (context) {
      context.try(:trailguide_user).try(:id) ||
        context.try(:current_user).try(:id)
    }
    config.expiration = nil

    yield(config) if block_given?
  end
end