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

minor edits for consistency, readability

This commit is contained in:
Will Schive 2014-01-29 07:57:55 -08:00
parent 3f5e66d08a
commit 6b0148ff7c

View file

@ -137,7 +137,7 @@ class ApplicationController < ActionController::Base
end end
``` ```
Likewise, pundit also adds `verify_policy_scoped` to your controller. This Likewise, Pundit also adds `verify_policy_scoped` to your controller. This
will raise an exception in the vein of `verify_authorized`. However it tracks will raise an exception in the vein of `verify_authorized`. However it tracks
if `policy_scoped` is used instead of `authorize`. This is mostly useful for if `policy_scoped` is used instead of `authorize`. This is mostly useful for
controller actions like `index` which find collections with a scope and don't controller actions like `index` which find collections with a scope and don't
@ -306,10 +306,10 @@ Pundit.policy_scope(user, Post)
The bang methods will raise an exception if the policy does not exist, whereas The bang methods will raise an exception if the policy does not exist, whereas
those without the bang will return nil. those without the bang will return nil.
## Customize pundit user ## Customize Pundit user
In some cases your controller might not have access to `current_user`, or your In some cases your controller might not have access to `current_user`, or your
`current_user` is not the method one that should be invoked by pundit. Simply `current_user` is not the method that should be invoked by Pundit. Simply
define a method in your controller called `pundit_user`. define a method in your controller called `pundit_user`.
```ruby ```ruby