1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Make a note of manual policy class specification

This commit is contained in:
Jonas Nicklas 2013-01-08 09:46:20 +01:00
parent 75683fe159
commit 5ad9821ae1

View file

@ -195,6 +195,19 @@ You can, and are encouraged to, use this method in views:
<% end %>
```
## Manually specifying policy classes
Sometimes you might want to explicitly declare which policy to use for a given
class, instead of letting Pundit infer it. This can be done like so:
``` ruby
class Post
def self.policy_class
PostablePolicyClass
end
end
```
## Just plain old Ruby
As you can see, Pundit doesn't do anything you couldn't have easily done