README.md in active_model_serializers-0.8.3 vs README.md in active_model_serializers-0.8.4
- old
+ new
@@ -43,20 +43,37 @@
```
$ rails g serializer post
```
-### Support for PORO's and other ORM's.
+### Support for POROs and other ORMs.
Currently `ActiveModel::Serializers` adds serialization support to all models
-that descend from `ActiveRecord` or include `Mongoid::Document`. If you are
-using another ORM, or if you are using objects that are `ActiveModel`
-compliant but do not descend from `ActiveRecord` or include
-`Mongoid::Document`, you must add an include statement for
-`ActiveModel::SerializerSupport` to make models serializable. If you
-also want to make collections serializable, you should include
+that descend from `ActiveRecord` or include `Mongoid::Document`. If you are:
+
+- using another ORM, or
+- using objects that are `ActiveModel` compliant but do not descend from
+`ActiveRecord` *or* include `Mongoid::Document`
+
+You must add an include statement for `ActiveModel::SerializerSupport` to
+make models serializable.
+
+If you also want to make collections serializable, you should include
`ActiveModel::ArraySerializerSupport` into your ORM's
relation/criteria class.
+
+Example model (`app/models/avatar.rb`):
+
+```ruby
+class Avatar
+ include ActiveModel::SerializerSupport
+ # etc, etc
+end
+```
+
+If your classes follow the naming conventions prescribed by `ActiveModel`,
+you don't need to do anything different in your controller to render the
+serialized json.
# ActiveModel::Serializer
All new serializers descend from ActiveModel::Serializer