提交 5e84a24f 编写于 作者: C claudiob

Add doc for `:touch` option of AR::Base#save

ActiveRecord::Base `save` and `save!` take an option boolean
`:touch` parameter since #18225 (stems from #18202).

This commit document that parameter.

[ci skip]
上级 8beb781d
......@@ -109,6 +109,10 @@ def persisted?
# validate: false, validations are bypassed altogether. See
# ActiveRecord::Validations for more information.
#
# By default, #save also sets the +updated_at+/+updated_on+ attributes to
# the current time. However, if you supply <tt>touch: false</tt>, these
# timestamps will not be updated.
#
# There's a series of callbacks associated with +save+. If any of the
# <tt>before_*</tt> callbacks return +false+ the action is cancelled and
# +save+ returns +false+. See ActiveRecord::Callbacks for further
......@@ -131,6 +135,10 @@ def save(*args)
# ActiveRecord::RecordInvalid gets raised. See ActiveRecord::Validations
# for more information.
#
# By default, #save! also sets the +updated_at+/+updated_on+ attributes to
# the current time. However, if you supply <tt>touch: false</tt>, these
# timestamps will not be updated.
#
# There's a series of callbacks associated with <tt>save!</tt>. If any of
# the <tt>before_*</tt> callbacks return +false+ the action is cancelled
# and <tt>save!</tt> raises ActiveRecord::RecordNotSaved. See
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册