diff options
author | Oscar Del Ben <info@oscardelben.com> | 2012-04-25 11:27:09 +0200 |
---|---|---|
committer | Oscar Del Ben <info@oscardelben.com> | 2012-04-25 11:27:09 +0200 |
commit | e34a4014ad2bf1d52c934f06093d179f469c62ac (patch) | |
tree | 60ac6603cb7bca13a4819ef378526f5888d37945 /activemodel | |
parent | 93bcb0c268c6df0cd6e14a7c880897ef7fa42df1 (diff) | |
download | rails-e34a4014ad2bf1d52c934f06093d179f469c62ac.tar.gz rails-e34a4014ad2bf1d52c934f06093d179f469c62ac.tar.bz2 rails-e34a4014ad2bf1d52c934f06093d179f469c62ac.zip |
improve serialization doc
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 4323ee1e09..d0bd8bab15 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -26,17 +26,18 @@ module ActiveModel # person.serializable_hash # => {"name"=>"Bob"} # # You need to declare an attributes hash which contains the attributes - # you want to serialize. When called, serializable hash will use + # you want to serialize. Attributes must be strings, not symbols. + # When called, serializable hash will use # instance methods that match the name of the attributes hash's keys. # In order to override this behavior, take a look at the private - # method read_attribute_for_serialization. + # method ++read_attribute_for_serialization++. # # Most of the time though, you will want to include the JSON or XML # serializations. Both of these modules automatically include the - # ActiveModel::Serialization module, so there is no need to explicitly + # ++ActiveModel::Serialization++ module, so there is no need to explicitly # include it. # - # So a minimal implementation including XML and JSON would be: + # A minimal implementation including XML and JSON would be: # # class Person # include ActiveModel::Serializers::JSON |