aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2014-03-20 08:08:22 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2014-03-20 08:08:22 -0300
commitbebe4a9ddde078c091e48ab06c4ca4c8da37203f (patch)
treedda2946876af89011888c9ace9f157020abd6e6e /activerecord/lib/active_record/persistence.rb
parent140ea2251b17ee9851e2511bf0a82a9e62197cd7 (diff)
downloadrails-bebe4a9ddde078c091e48ab06c4ca4c8da37203f.tar.gz
rails-bebe4a9ddde078c091e48ab06c4ca4c8da37203f.tar.bz2
rails-bebe4a9ddde078c091e48ab06c4ca4c8da37203f.zip
Improve touch docs with extra attributes passed in [ci skip]
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index eb45289b2e..c20499d081 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -407,14 +407,16 @@ module ActiveRecord
# Saves the record with the updated_at/on attributes set to the current time.
# Please note that no validation is performed and only the +after_touch+,
# +after_commit+ and +after_rollback+ callbacks are executed.
- # If an attribute name is passed, that attribute is updated along with
- # updated_at/on attributes.
#
- # product.touch # updates updated_at/on
- # product.touch(:designed_at) # updates the designed_at attribute and updated_at/on
+ # If attribute names are passed, they are updated along with updated_at/on
+ # attributes.
+ #
+ # product.touch # updates updated_at/on
+ # product.touch(:designed_at) # updates the designed_at attribute and updated_at/on
# product.touch(:started_at, :ended_at) # updates started_at, ended_at and updated_at/on attributes
#
- # If used along with +belongs_to+ then +touch+ will invoke +touch+ method on associated object.
+ # If used along with +belongs_to+ then +touch+ will invoke +touch+ method on
+ # associated object.
#
# class Brake < ActiveRecord::Base
# belongs_to :car, touch: true