From 5075436673353d201c06c26a9bc65b378c66188f Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Wed, 3 Sep 2014 08:46:44 +0200 Subject: [PATCH] Change :embed_key to :key --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fbcf9152..b9c44c78 100644 --- a/README.md +++ b/README.md @@ -513,15 +513,15 @@ Now, any associations will be supplied as an Array of IDs: } ``` -You may also choose to embed the IDs by the association's name underneath an -`embed_key` for the resource. For example, say we want to change `comment_ids` +You may also choose to embed the IDs by the association's name underneath a +`key` for the resource. For example, say we want to change `comment_ids` to `comments` underneath a `links` key: ```ruby class PostSerializer < ActiveModel::Serializer attributes :id, :title, :body - has_many :comments, embed: :ids, embed_namespace: :links + has_many :comments, embed: :ids, key: :comments, embed_namespace: :links end ``` @@ -683,7 +683,7 @@ class PostSerializer < ActiveModel::Serializer embed :ids, include: true attributes :id, :title, :body - has_many :comments, embed_key: :external_id + has_many :comments, key: :external_id end ```