Support has_one to be compatible with 0.8.x

Update README and CHANGELOG
This commit is contained in:
Gary Gordon
2014-11-06 14:54:16 -05:00
parent 77fb050d24
commit 651b99f22e
6 changed files with 66 additions and 7 deletions

View File

@@ -224,13 +224,14 @@ $ rails g serializer post
```
The generated seralizer will contain basic `attributes` and
`has_many`/`belongs_to` declarations, based on the model. For example:
`has_many`/`has_one`/`belongs_to` declarations, based on the model. For example:
```ruby
class PostSerializer < ActiveModel::Serializer
attributes :title, :body
has_many :comments
has_one :author
url :post
end
@@ -250,7 +251,7 @@ end
The attribute names are a **whitelist** of attributes to be serialized.
The `has_many` and `belongs_to` declarations describe relationships between
The `has_many`, `has_one`, and `belongs_to` declarations describe relationships between
resources. By default, when you serialize a `Post`, you will get its `Comment`s
as well.