aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-25 00:22:53 +0200
committerXavier Noria <fxn@hashref.com>2010-08-25 00:22:53 +0200
commita820bd9df6476540edb58e32fe88a142a38a8e0b (patch)
tree5b83e8694cffecfd0e277407de5c65d06db99a63 /activerecord/lib/active_record/persistence.rb
parent036f090df1c1595ef47a8badf7514485f7de06c3 (diff)
downloadrails-a820bd9df6476540edb58e32fe88a142a38a8e0b.tar.gz
rails-a820bd9df6476540edb58e32fe88a142a38a8e0b.tar.bz2
rails-a820bd9df6476540edb58e32fe88a142a38a8e0b.zip
edit pass to a recent doc patch
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 1ce86da2fa..bf8089f042 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -213,9 +213,16 @@ module ActiveRecord
#
# If used along with +belongs_to+ then +touch+ will invoke +touch+ method on associated object.
#
- # Brake.belongs_to :car, :touch => true
- # Car.belongs_to :corporation, :touch => true
- # @brake.touch #=> will also invoke @brake.car.touch and @brake.car.corporation.touch
+ # class Brake < ActiveRecord::Base
+ # belongs_to :car, :touch => true
+ # end
+ #
+ # class Car < ActiveRecord::Base
+ # belongs_to :corporation, :touch => true
+ # end
+ #
+ # # triggers @brake.car.touch and @brake.car.corporation.touch
+ # @brake.touch
def touch(name = nil)
attributes = timestamp_attributes_for_update_in_model
unless attributes.blank?