4
4
<tr >
5
5
<td>Build Status</td>
6
6
<td>
7
- <a href="https://travis-ci.org/rails-api/active_model_serializers"><img src="https://travis-ci.org/rails-api/active_model_serializers.svg?branch=master " alt="Build Status" ></a>
8
- <a href="https://ci.appveyor.com/project/joaomdmoura /active-model-serializers/branch/master "><img src="https://ci.appveyor.com/api/projects/status/x6xdjydutm54gvyt/branch/master?svg=true" alt="Build status"></a>
7
+ <a href="https://travis-ci.org/rails-api/active_model_serializers"><img src="https://api. travis-ci.org/rails-api/active_model_serializers.svg?branch=0-10-stable " alt="Build Status" ></a>
8
+ <a href="https://ci.appveyor.com/project/bf4 /active-model-serializers/branch/0-10-stable "><img src="https://ci.appveyor.com/api/projects/status/x6xdjydutm54gvyt/branch/master?svg=true" alt="Build status"></a>
9
9
</td>
10
10
</tr >
11
11
<tr >
@@ -41,7 +41,7 @@ these methods to the adapter.)
41
41
42
42
By default ActiveModelSerializers will use the ** Attributes Adapter** (no JSON root).
43
43
But we strongly advise you to use ** JsonApi Adapter** , which
44
- follows 1.0 of the format specified in [ jsonapi.org/format] ( http ://jsonapi.org/format) .
44
+ follows 1.0 of the format specified in [ jsonapi.org/format] ( https ://jsonapi.org/format) .
45
45
Check how to change the adapter in the sections below.
46
46
47
47
` 0.10.x ` is ** not** backward compatible with ` 0.9.x ` nor ` 0.8.x ` .
@@ -75,9 +75,9 @@ More information is available in the [Guides](docs) and
75
75
If you find a bug, please report an [ Issue] ( https://github.com/rails-api/active_model_serializers/issues/new )
76
76
and see our [ contributing guide] ( CONTRIBUTING.md ) .
77
77
78
- If you have a question, please [ post to Stack Overflow] ( http ://stackoverflow.com/questions/tagged/active-model-serializers) .
78
+ If you have a question, please [ post to Stack Overflow] ( https ://stackoverflow.com/questions/tagged/active-model-serializers) .
79
79
80
- If you'd like to chat, we have a [ community slack] ( http ://amserializers.herokuapp.com) .
80
+ If you'd like to chat, we have a [ community slack] ( https ://amserializers.herokuapp.com) .
81
81
82
82
Thanks!
83
83
@@ -87,14 +87,14 @@ If you're reading this at https://github.com/rails-api/active_model_serializers
87
87
reading documentation for our ` master ` , which may include features that have not
88
88
been released yet. Please see below for the documentation relevant to you.
89
89
90
- - [ 0.10 (master ) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/master )
91
- - [ 0.10.6 (latest release) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/v0.10.6 )
92
- - [ ![ API Docs] ( http ://img.shields.io/badge/yard-docs-blue.svg)] ( http ://www.rubydoc.info/gems/active_model_serializers/0.10.6 )
93
- - [ Guides] ( docs )
90
+ - [ 0.10 (0-10-stable ) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/0-10-stable )
91
+ - [ 0.10.10 (latest release) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/v0.10.10 )
92
+ - [ ![ API Docs] ( https ://img.shields.io/badge/yard-docs-blue.svg)] ( https ://www.rubydoc.info/gems/active_model_serializers/0.10.10 )
93
+ - [ Guides] ( docs )
94
94
- [ 0.9 (0-9-stable) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/0-9-stable )
95
- - [ ![ API Docs] ( http ://img.shields.io/badge/yard-docs-blue.svg)] ( http ://www.rubydoc.info/github/rails-api/ active_model_serializers/0-9-stable )
95
+ - [ ![ API Docs] ( https ://img.shields.io/badge/yard-docs-blue.svg)] ( https ://www.rubydoc.info/gems/ active_model_serializers/0.9.7 )
96
96
- [ 0.8 (0-8-stable) Documentation] ( https://github.com/rails-api/active_model_serializers/tree/0-8-stable )
97
- - [ ![ API Docs] ( http ://img.shields.io/badge/yard-docs-blue.svg)] ( http ://www.rubydoc.info/github/rails-api/ active_model_serializers/0-8-stable )
97
+ - [ ![ API Docs] ( https ://img.shields.io/badge/yard-docs-blue.svg)] ( https ://www.rubydoc.info/gems/ active_model_serializers/0.8.4 )
98
98
99
99
100
100
## High-level behavior
@@ -171,12 +171,12 @@ The original design is also available [here](https://github.com/rails-api/active
171
171
172
172
### ActiveModel::Serializer
173
173
174
- An ** ` ActiveModel::Serializer ` ** wraps a [ serializable resource] ( https://github.com/rails/rails/blob/4-2-stable /activemodel/lib/active_model/serialization.rb )
174
+ An ** ` ActiveModel::Serializer ` ** wraps a [ serializable resource] ( https://github.com/rails/rails/blob/master /activemodel/lib/active_model/serialization.rb )
175
175
and exposes an ` attributes ` method, among a few others.
176
176
It allows you to specify which attributes and associations should be represented in the serializatation of the resource.
177
177
It requires an adapter to transform its attributes into a JSON document; it cannot be serialized itself.
178
178
It may be useful to think of it as a
179
- [ presenter] ( http ://blog.steveklabnik.com/posts/2011-09-09-better-ruby-presenters) .
179
+ [ presenter] ( https ://blog.steveklabnik.com/posts/2011-09-09-better-ruby-presenters) .
180
180
181
181
#### ActiveModel::CollectionSerializer
182
182
@@ -188,7 +188,7 @@ and, if there is no serializer, primitives.
188
188
The ** ` ActiveModelSerializers::Adapter::Base ` ** describes the structure of the JSON document generated from a
189
189
serializer. For example, the ` Attributes ` example represents each serializer as its
190
190
unmodified attributes. The ` JsonApi ` adapter represents the serializer as a [ JSON
191
- API] ( http ://jsonapi.org/) document.
191
+ API] ( https ://jsonapi.org/) document.
192
192
193
193
### ActiveModelSerializers::SerializableResource
194
194
@@ -229,7 +229,7 @@ High-level overview:
229
229
- ` :each_serializer ` specifies the serializer for each resource in the collection.
230
230
- For a ** single resource** , the ` :serializer ` option is the resource serializer.
231
231
- Options are partitioned in serializer options and adapter options. Keys for adapter options are specified by
232
- [ ` ADAPTER_OPTION_KEYS ` ] ( https://github.com/rails-api/active_model_serializers/blob/master/ lib/active_model_serializers/serializable_resource.rb#L5) .
232
+ [ ` ADAPTER_OPTION_KEYS ` ] ( lib/active_model_serializers/serializable_resource.rb#L5 ) .
233
233
The remaining options are serializer options.
234
234
235
235
Details:
@@ -254,7 +254,7 @@ Details:
254
254
2 . ` adapter_instance = ActiveModel::Serializer::Adapter.create(serializer_instance, adapter_opts) `
255
255
1 . ** ActiveModel::Serializer::CollectionSerializer#new**
256
256
1 . If the ` serializer_instance ` was a ` CollectionSerializer ` and the ` :serializer ` serializer_opts
257
- is present, then [ that serializer is passed into each resource] ( https://github.com/rails-api/active_model_serializers/blob/a54d237e2828fe6bab1ea5dfe6360d4ecc8214cd /lib/active_model/serializer/array_serializer .rb#L14-L16 ) .
257
+ is present, then [ that serializer is passed into each resource] ( https://github.com/rails-api/active_model_serializers/blob/0-10-stable /lib/active_model/serializer/collection_serializer .rb#L77-L79 ) .
258
258
1 . ** ActiveModel::Serializer#attributes** is used by the adapter to get the attributes for
259
259
resource as defined by the serializer.
260
260
@@ -270,7 +270,7 @@ to know about, but not part of ActiveModelSerializers.)
270
270
[ (code)] ( lib/active_model/serializer/lint.rb ) .
271
271
272
272
ActiveModelSerializers provides a
273
- [ ` ActiveModelSerializers::Model ` ] ( https://github.com/rails-api/active_model_serializers/blob/master/ lib/active_model_serializers/model.rb) ,
273
+ [ ` ActiveModelSerializers::Model ` ] ( lib/active_model_serializers/model.rb ) ,
274
274
which is a simple serializable PORO (Plain-Old Ruby Object).
275
275
276
276
` ActiveModelSerializers::Model ` may be used either as a reference implementation, or in production code.
@@ -298,7 +298,7 @@ ActiveModelSerializers::SerializableResource.new(MyModel.new(level: 'awesome'),
298
298
299
299
## Semantic Versioning
300
300
301
- This project adheres to [ semver] ( http ://semver.org/)
301
+ This project adheres to [ semver] ( https ://semver.org/)
302
302
303
303
## Contributing
304
304
0 commit comments