Commit 187a2f43 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'sam.figueroa-master-patch-84586' into 'master'

Update policies.md

See merge request gitlab-org/gitlab!77007
parents 3142c5d9 f8e19abc
...@@ -79,7 +79,7 @@ cop](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49771). ...@@ -79,7 +79,7 @@ cop](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49771).
## Scores, Order, Performance ## Scores, Order, Performance
To see how the rules get evaluated into a judgment, it is useful in a console to use `policy.debug(:some_ability)`. This prints the rules in the order they are evaluated. To see how the rules get evaluated into a judgment, open a Rails console and run: `policy.debug(:some_ability)`. This prints the rules in the order they are evaluated.
For example, let's say you wanted to debug `IssuePolicy`. You might run For example, let's say you wanted to debug `IssuePolicy`. You might run
the debugger in this way: the debugger in this way:
...@@ -222,7 +222,7 @@ delegation would end up with only children whose parents enjoy green vegetables ...@@ -222,7 +222,7 @@ delegation would end up with only children whose parents enjoy green vegetables
eating it. But a parent may well give their child broccoli, even if they dislike eating it. But a parent may well give their child broccoli, even if they dislike
it themselves, because it is good for their child. it themselves, because it is good for their child.
The solution it to override the `:eat_broccoli` ability in the child policy: The solution is to override the `:eat_broccoli` ability in the child policy:
```ruby ```ruby
class ChildPolicy < BasePolicy class ChildPolicy < BasePolicy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment