Method: Pundit.policy!

Defined in:
lib/pundit.rb

.policy!(user, record) ⇒ Object

Retrieves the policy for the given record.

Parameters:

  • user (Object)

    the user that initiated the action

  • record (Object)

    the object we're retrieving the policy for

Returns:

  • (Object)

    instance of policy class with query methods

Raises:

See Also:



111
112
113
# File 'lib/pundit.rb', line 111

def policy!(user, record)
  PolicyFinder.new(record).policy!.new(user, record)
end