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

Fix error in code sample, closes #194

This commit is contained in:
Jonas Nicklas 2014-08-22 13:59:56 +02:00
parent d279643496
commit 3bdc40e563

View file

@ -75,11 +75,13 @@ generator, or set up your own base class to inherit from:
``` ruby
class PostPolicy < ApplicationPolicy
def update?
user.admin? or not post.published?
user.admin? or not record.published?
end
end
```
In the generated `ApplicationPolicy`, the model object is called `record`.
Supposing that you have an instance of class `Post`, Pundit now lets you do
this in your controller: