You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[#1839](https://github.com/rails-api/active_model_serializers/pull/1839)`fields` tests demonstrating usage for both attributes and relationships. (@NullVoxPopuli)
29
31
-[#1812](https://github.com/rails-api/active_model_serializers/pull/1812) add a code of conduct (@corainchicago)
The **`ActiveModel::ArraySerializer`**represent a collection of resources as serializers
18
+
The **`ActiveModel::CollectionSerializer`**represents a collection of resources as serializers
19
19
and, if there is no serializer, primitives.
20
20
21
21
The **`ActiveModel::Adapter`** describes the structure of the JSON document generated from a
@@ -42,10 +42,9 @@ it is not modified.
42
42
Internally, if no serializer can be found in the controller, the resource is not decorated by
43
43
ActiveModelSerializers.
44
44
45
-
If the collection serializer (ArraySerializer) cannot
46
-
identify a serializer for a resource in its collection, it raises [`NoSerializerError`](https://github.com/rails-api/active_model_serializers/issues/1191#issuecomment-142327128)
47
-
which is rescued in `ActiveModel::Serializer::Reflection#build_association` which sets
48
-
the association value directly:
45
+
If the collection serializer (CollectionSerializer) cannot
46
+
identify a serializer for a resource in its collection, it throws [`:no_serializer`](https://github.com/rails-api/active_model_serializers/issues/1191#issuecomment-142327128).
47
+
For example, when caught by `Reflection#build_association`, the association value is set directly:
1. If the `serializer_instance` was a `CollectionSerializer` and the `:serializer` serializer_opts
90
89
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).
91
90
1.**ActiveModel::Serializer#attributes** is used by the adapter to get the attributes for
0 commit comments