diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-06-10 08:50:39 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-06-10 08:50:39 -0300 |
commit | 96bb004fc6e67cdf1b873f11ad5f8efd06949797 (patch) | |
tree | 8117911b42a08226576d42afd127b39c55f9f0fb /activemodel/lib | |
parent | d5d3d3d6585330ae10fa892b2cde6e8ac90d5156 (diff) | |
download | rails-96bb004fc6e67cdf1b873f11ad5f8efd06949797.tar.gz rails-96bb004fc6e67cdf1b873f11ad5f8efd06949797.tar.bz2 rails-96bb004fc6e67cdf1b873f11ad5f8efd06949797.zip |
Revert "Add code example for include option of AM::Serialization#serializable_hash"
This reverts commit 3d949f34816d6eca0a6b59cfa08d91f36e8e64dd.
This was already documented in other PR.
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 144ee2ce6e..f95849eb84 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -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} |