提交 6071d626 编写于 作者: A Arthur Nogueira Neves

Merge pull request #15690 from deeeki/activemodel_model_doc

[ci skip] Clarify ActiveModel::Model docs
......@@ -16,8 +16,8 @@ module ActiveModel
# end
#
# person = Person.new(name: 'bob', age: '18')
# person.name # => 'bob'
# person.age # => 18
# person.name # => "bob"
# person.age # => "18"
#
# Note that, by default, <tt>ActiveModel::Model</tt> implements <tt>persisted?</tt>
# to return +false+, which is the most common case. You may want to override
......@@ -74,7 +74,7 @@ def self.included(base) #:nodoc:
#
# person = Person.new(name: 'bob', age: '18')
# person.name # => "bob"
# person.age # => 18
# person.age # => "18"
def initialize(params={})
params.each do |attr, value|
self.public_send("#{attr}=", value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册