README.md in pragma-2.3.0 vs README.md in pragma-2.4.0
- old
+ new
@@ -1,9 +1,8 @@
# Pragma
[![Build Status](https://travis-ci.org/pragmarb/pragma.svg?branch=master)](https://travis-ci.org/pragmarb/pragma)
-[![Dependency Status](https://gemnasium.com/badges/github.com/pragmarb/pragma.svg)](https://gemnasium.com/github.com/pragmarb/pragma)
[![Coverage Status](https://coveralls.io/repos/github/pragmarb/pragma/badge.svg?branch=master)](https://coveralls.io/github/pragmarb/pragma?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/e51e8d7489eb72ab97ba/maintainability)](https://codeclimate.com/github/pragmarb/pragma/maintainability)
Welcome to Pragma, an expressive, opinionated ecosystem for building beautiful RESTful APIs with
Ruby.
@@ -294,10 +293,15 @@
If the user is not authorized to perform the operation (i.e. if the policy's `#show?` method returns
`false`), the macro will respond with `403 Forbidden` and a descriptive error message. If you want
to override the error handling logic, you can remove the `fail_fast` option and instead implement
your own `failure` step.
+The macro accepts the following options, which can be defined on the operation or at runtime:
+
+- `policy.context`: the context to use for the policy (optional, `current_user` is used if not
+ provided).
+
### Filtering
**Used in:** Index
The `Filtering` macro provides a simple interface to define basic filters for your API. You simply
@@ -336,10 +340,11 @@
- `Like`: performs a `LIKE` comparison (requires `:column`).
- `Ilike`: performs an `ILIKE` comparison (requires `:column`).
- `Where`: adds a generic `WHERE` clause (requires `:condition` and passes the parameter's value as
`:value`).
- `Scope`: calls a method on the collection (requires `:scope` and passes the parameter's value as
- the first argument).
+ the first argument);
+- `Boolean`: calls a method on the collection (requires `:scope` and doesn't pass any arguments).
Support for more clauses as well as more ORMs will come soon.
### Ordering