Module: Pundit::CacheStore

Defined in:
lib/pundit/cache_store.rb,
lib/pundit/cache_store/null_store.rb,
lib/pundit/cache_store/legacy_store.rb

Overview

Namespace for cache store implementations.

Cache stores are used to cache policy lookups, so you get the same policy instance for the same record.

Since:

  • v2.3.2

Defined Under Namespace

Classes: LegacyStore, NullStore

Cache Store Interface collapse

Instance Method Details

#fetch(user: , record: , &block) ⇒ Object

Note:

This is a method template, but the method does not exist in this module.

Looks up a stored policy or generate a new one.

Parameters:

  • user (Object) (defaults to: )

    the user that initiated the action

  • record (Object) (defaults to: )

    the object being accessed

  • block (Proc)

    the block to execute if missing

Returns:

  • (Object)

    the policy

Since:

  • v2.3.2



# File 'lib/pundit/cache_store.rb', line 12