Method: ActionPolicy::Ext::PolicyCacheKey::ObjectExt#_policy_cache_key
- Defined in:
- lib/action_policy/ext/policy_cache_key.rb
#_policy_cache_key(use_object_id: false) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/action_policy/ext/policy_cache_key.rb', line 14 def _policy_cache_key(use_object_id: false) return policy_cache_key if respond_to?(:policy_cache_key) return cache_key_with_version if respond_to?(:cache_key_with_version) return cache_key if respond_to?(:cache_key) return object_id.to_s if use_object_id == true raise ArgumentError, "object is not cacheable" end |