mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Add code example for include option of AM::Serialization#serializable_hash"
This reverts commit 3d949f3481
.
This was already documented in other PR.
This commit is contained in:
parent
d5d3d3d658
commit
96bb004fc6
1 changed files with 1 additions and 14 deletions
|
@ -72,20 +72,10 @@ module ActiveModel
|
|||
module Serialization
|
||||
# Returns a serialized hash of your object.
|
||||
#
|
||||
# class Address
|
||||
# include ActiveModel::Serialization
|
||||
#
|
||||
# attr_accessor :city, :street
|
||||
#
|
||||
# def attributes
|
||||
# {'city' => nil, 'street' => nil}
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# class Person
|
||||
# include ActiveModel::Serialization
|
||||
#
|
||||
# attr_accessor :name, :age, :address
|
||||
# attr_accessor :name, :age
|
||||
#
|
||||
# def attributes
|
||||
# {'name' => nil, 'age' => nil}
|
||||
|
@ -99,9 +89,6 @@ module ActiveModel
|
|||
# person = Person.new
|
||||
# person.name = 'bob'
|
||||
# person.age = 22
|
||||
# person.address = Address.new
|
||||
# person.address.city = 'New York'
|
||||
# person.address.street = 'Main St'
|
||||
# person.serializable_hash # => {"name"=>"bob", "age"=>22}
|
||||
# person.serializable_hash(only: :name) # => {"name"=>"bob"}
|
||||
# person.serializable_hash(except: :name) # => {"age"=>22}
|
||||
|
|
Loading…
Reference in a new issue