mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
fixed doc : ActiveModel::Serializer takes care of object initialization
This commit is contained in:
parent
03f08a8351
commit
1a8526239f
@ -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?
|
||||
|
||||
Loading…
Reference in New Issue
Block a user