Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

edit pass to a recent doc patch

  • Loading branch information...
commit a820bd9df6476540edb58e32fe88a142a38a8e0b 1 parent 036f090
@fxn fxn authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 activerecord/lib/active_record/persistence.rb
View
13 activerecord/lib/active_record/persistence.rb
@@ -213,9 +213,16 @@ def reload(options = nil)
#
# 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?
Please sign in to comment.
Something went wrong with that request. Please try again.