class Pundit::Context

def policy(record)

Returns:
  • (Object, nil) - instance of policy class with query methods

Raises:
  • (InvalidConstructorError) - if the policy constructor called incorrectly

Parameters:
  • record (Object) -- the object we're retrieving the policy for

Other tags:
    See: https://github.com/varvet/pundit#policies -
def policy(record)
  cached_find(record, &:policy)
end