mirror of
https://github.com/samsonjs/grape-active_model_serializers.git
synced 2026-03-25 08:45:55 +00:00
Adds warning about change of array root behaviour in 1.0
This commit is contained in:
parent
02c2b1451b
commit
c84a0ea230
1 changed files with 11 additions and 1 deletions
12
README.md
12
README.md
|
|
@ -4,6 +4,10 @@ Use [active_model_serializers](https://github.com/rails-api/active_model_seriali
|
|||
|
||||
[](http://travis-ci.org/jrhe/grape-active_model_serializers) [](https://gemnasium.com/jrhe/grape-active_model_serializers) [](https://codeclimate.com/github/jrhe/grape-active_model_serializers)
|
||||
|
||||
## Breaking Changes
|
||||
#### v1.0.0
|
||||
* *BREAKING* Changes behaviour of root keys when serialising arrays. See [Array roots](https://github.com/jrhe/grape-active_model_serializers#array-roots)
|
||||
|
||||
## Installation
|
||||
|
||||
Add the `grape` and `grape-active_model_serializers` gems to Gemfile.
|
||||
|
|
@ -56,7 +60,7 @@ end
|
|||
In this case, as User objects are being returned, grape-active_model_serializers will look for a serializer named UserSerializer.
|
||||
|
||||
### Array roots
|
||||
When serializing an array, the array root is set to the innermost namespace name if there is one, otherwise it is set to the route name (e.g. get 'name')
|
||||
When serializing an array, the array root is set to the innermost namespace name if there is one, otherwise it is set to the route name (e.g. get 'name').
|
||||
|
||||
```ruby
|
||||
namespace :users do
|
||||
|
|
@ -123,6 +127,12 @@ See "Writing Tests" in https://github.com/intridea/grape.
|
|||
|
||||
Enjoy :)
|
||||
|
||||
## Changelog
|
||||
|
||||
#### v1.0.0
|
||||
* Released on rubygems.org
|
||||
* *BREAKING* Changes behaviour of root keys when serialising arrays. See [Array roots](https://github.com/jrhe/grape-active_model_serializers#array-roots)
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue