diff options
author | Zachary Scott <e@zzak.io> | 2014-06-16 11:32:34 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-06-16 11:32:34 -0700 |
commit | d60c405be2d09318acc5e30b37553187e0d75319 (patch) | |
tree | 3627d930f53e43cd407bf70d0c31a1ba73777922 /activemodel | |
parent | 78ae3a30f0323c9c77561e8cd35d8f94e6daa111 (diff) | |
parent | eb5d802cab062a28c336e70f3ae0dc997449073b (diff) | |
download | rails-d60c405be2d09318acc5e30b37553187e0d75319.tar.gz rails-d60c405be2d09318acc5e30b37553187e0d75319.tar.bz2 rails-d60c405be2d09318acc5e30b37553187e0d75319.zip |
Merge pull request #15751 from aditya-kapoor/correct-serialization-doc
[ci skip] correct doc for serialization in accordance with API Doc Guide
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 36a6c00290..95afc8d935 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -4,7 +4,7 @@ require 'active_support/core_ext/hash/slice' module ActiveModel # == Active \Model \Serialization # - # Provides a basic serialization to a serializable_hash for your object. + # Provides a basic serialization to a serializable_hash for your objects. # # A minimal implementation could be: # @@ -25,16 +25,16 @@ module ActiveModel # person.name = "Bob" # person.serializable_hash # => {"name"=>"Bob"} # - # You need to declare an attributes hash which contains the attributes 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+. - # - # Most of the time though, you will want to include the JSON or XML - # serializations. Both of these modules automatically include the - # <tt>ActiveModel::Serialization</tt> module, so there is no need to - # explicitly include it. + + # An +attributes+ hash must be defined and should contain any attributes you + # need to be serialized. 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+. + # + # Most of the time though, either the JSON or XML serializations are needed. + # Both of these modules automatically include the <tt>ActiveModel::Serialization</tt> + # module, so there is no need to explicitly include it. # # A minimal implementation including XML and JSON would be: # |