class Pundit::Context

def policy!(record)

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

Raises:
  • (InvalidConstructorError) - if the policy constructor called incorrectly
  • (NotDefinedError) - if the policy cannot be found

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