class Pundit::CacheStore::LegacyStore
A cache store that uses only the record as a cache key, and ignores the user.
The original cache mechanism used by Pundit
.
@api private
Public Class Methods
Source
# File lib/pundit/cache_store/legacy_store.rb, line 11 def initialize(hash = {}) @store = hash end
Public Instance Methods
Source
# File lib/pundit/cache_store/legacy_store.rb, line 18 def fetch(user:, record:) _ = user @store[record] ||= yield end
A cache store that uses only the record as a cache key, and ignores the user.
@note ‘nil` results are not cached.