Skip to content

Commit d3a8006

Browse files
committed
Wording and typos.
1 parent a5defcb commit d3a8006

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/ARCHITECTURE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An **`ActiveModel::Serializer`** wraps a [serializable resource](https://github.com/rails/rails/blob/4-2-stable/activemodel/lib/active_model/serialization.rb)
44
and exposes an `attributes` method, among a few others.
5-
It allows you to specify which attributes and associations should represent the serialization of the resource.
5+
It allows you to specify which attributes and associations should be represented in the serializatation of the resource.
66
It requires an adapter to transform its attributes into a JSON document; it cannot be serialized itself.
77
It may be useful to think of it as a
88
[presenter](http://blog.steveklabnik.com/posts/2011-09-09-better-ruby-presenters).
@@ -12,12 +12,12 @@ and, if there is no serializer, primitives.
1212

1313
The **`ActiveModel::Adapter`** describes the structure of the JSON document generated from a
1414
serializer. For example, the `Attributes` example represents each serializer as its
15-
unmodified attributes. The `JsonApi` adatper represents the serializer as a [JSON
15+
unmodified attributes. The `JsonApi` adapter represents the serializer as a [JSON
1616
API](jsonapi.org/) document.
1717

1818
The **`ActiveModel::SerializableResource`** acts to coordinate the serializer(s) and adapter
1919
to an object that responds to `to_json`, and `as_json`. It is used in the controller to
20-
encapsulate the serialization resource when rendered. Thus, it can be used on its own
20+
encapsulate the serialization resource when rendered. However, it can also be used on its own
2121
to serialize a resource outside of a controller, as well.
2222

2323
## Primitive handling
@@ -29,7 +29,7 @@ defined for them; they will be serialized when the resource is converted to JSON
2929
ActiveModelSerializers doesn't handle primitives passed to `render json:` at all.
3030

3131
However, when a primitive value is an attribute or in a collection,
32-
it is is not modified.
32+
it is not modified.
3333

3434
Internally, if no serializer can be found in the controller, the resource is not decorated by
3535
ActiveModelSerializers.
@@ -50,8 +50,8 @@ reflection_options[:virtual_value] = association_value.try(:as_json) || associat
5050
High-level overview:
5151

5252
- For a collection
53-
- the collection serializer is the `:serializer` option and
54-
- `:each_serializer` is used as the serializer for each resource in the collection.
53+
- `:serializer` specifies the collection serializer and
54+
- `:each_serializer` specifies the serializer for each resource in the collection.
5555
- For a single resource, the `:serializer` option is the resource serializer.
5656
- Options are partitioned in serializer options and adapter options. Keys for adapter options are specified by
5757
[`ADAPTER_OPTIONS`](https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializable_resource.rb#L4).
@@ -92,7 +92,7 @@ Details:
9292

9393
ActiveModelSerializers provides a
9494
`[ActiveModelSerializers::Model](https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model_serializers/model.rb)`,
95-
which is a simple serializable PORO (plain-old Ruby object).
95+
which is a simple serializable PORO (Plain-Old Ruby Object).
9696

9797
ActiveModelSerializers::Model may be used either as a template, or in production code.
9898

0 commit comments

Comments
 (0)