Merge pull request #424 from cball/update-association-key-in-readme

Update README to reflect override of json key in associations
This commit is contained in:
Santiago Pastorino 2013-10-26 07:22:59 -07:00
commit 74d19e7d76

View File

@ -386,7 +386,7 @@ class PostSerializer < ActiveModel::Serializer
attributes :id, :title, :body
# look up comments, but use +my_comments+ as the key in JSON
has_many :comments, key: :my_comments
has_many :comments, root: :my_comments
end
```