From 5e84a24fcd4f9fc365f15adb230069d4beefb7d7 Mon Sep 17 00:00:00 2001 From: claudiob Date: Tue, 30 Dec 2014 00:31:04 +0100 Subject: 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] --- activerecord/lib/active_record/persistence.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index ded190c111..f53c5f17ef 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -109,6 +109,10 @@ module ActiveRecord # 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 touch: false, these + # timestamps will not be updated. + # # There's a series of callbacks associated with +save+. If any of the # before_* callbacks return +false+ the action is cancelled and # +save+ returns +false+. See ActiveRecord::Callbacks for further @@ -131,6 +135,10 @@ module ActiveRecord # 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 touch: false, these + # timestamps will not be updated. + # # There's a series of callbacks associated with save!. If any of # the before_* callbacks return +false+ the action is cancelled # and save! raises ActiveRecord::RecordNotSaved. See -- cgit v1.2.3