docs/writing_policies.md in action_policy-0.2.3 vs docs/writing_policies.md in action_policy-0.2.4

- old
+ new

@@ -52,9 +52,25 @@ end ``` You can also specify all the usual options (such as `with`). +There is also a `check?` method which is just an "alias"\* for `allowed_to?` added for better readability: + +``` +class PostPolicy < ApplicationPolicy + def show? + user.admin? || check?(:publicly_visible?) + end + + def publicly_visible? + # ... + end +end +``` + +\* It's not a Ruby _alias_ but a wrapper; we can't use `alias` or `alias_method`, 'cause `allowed_to?` could be extended by some extensions. + ## Identifiers Each policy class has an `identifier`, which is by default just an underscored class name: ```ruby