提交 d60c405b 编写于 作者: Z Zachary Scott

Merge pull request #15751 from aditya-kapoor/correct-serialization-doc

[ci skip] correct doc for serialization in accordance with API Doc Guide
......@@ -4,7 +4,7 @@
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:
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册