From 1a8526239f66c5a0fe85d4f305aa6abfeb10b757 Mon Sep 17 00:00:00 2001 From: Bounmy Stephane Date: Fri, 16 Dec 2011 11:51:57 -0800 Subject: [PATCH] fixed doc : ActiveModel::Serializer takes care of object initialization --- README.textile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.textile b/README.textile index 2b7b2acd..6743b8ac 100644 --- a/README.textile +++ b/README.textile @@ -193,10 +193,6 @@ JSON. In the above example, the +title+ and +body+ attributes were always includ class PostSerializer < ActiveModel::Serializer attributes :title, :body - def initialize(post, scope) - @post, @scope = post, scope - end - def serializable_hash hash = attributes hash.merge!(super_data) if super? @@ -355,7 +351,7 @@ h4. Modifying Associations You can also rename associations if required. Say for example you have an association that makes sense to be named one thing in your code, but another when data is serialized. -You can use the option to specify a different name for an association. +You can use the option to specify a different name for an association. Here is an exmaple: