File: //usr/local/rvm/gems/ruby-2.5.9/doc/activerecord-6.1.4.1/ri/ActiveRecord/Persistence/touch-i.ri
U:RDoc::AnyMethod[iI"
touch:ETI"$ActiveRecord::Persistence#touch;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"PSaves the record with the updated_at/on attributes set to the current time ;TI"or the time specified. ;TI"MPlease note that no validation is performed and only the +after_touch+, ;TI"@+after_commit+ and +after_rollback+ callbacks are executed.;To:RDoc::Markup::BlankLine o;
; [I"NThis method can be passed attribute names and an optional time argument. ;TI"NIf attribute names are passed, they are updated along with updated_at/on ;TI"Tattributes. If no time argument is passed, the current time is used as default.;T@o:RDoc::Markup::Verbatim; [ I"Uproduct.touch # updates updated_at/on with current time
;TI"eproduct.touch(time: Time.new(2015, 2, 16, 0, 0, 0)) # updates updated_at/on with specified time
;TI"aproduct.touch(:designed_at) # updates the designed_at attribute and updated_at/on
;TI"gproduct.touch(:started_at, :ended_at) # updates started_at, ended_at and updated_at/on attributes
;T:@format0o;
; [I"UIf used along with {belongs_to}[rdoc-ref:Associations::ClassMethods#belongs_to] ;TI"Bthen +touch+ will invoke +touch+ method on associated object.;T@o;; [I"&class Brake < ActiveRecord::Base
;TI"$ belongs_to :car, touch: true
;TI" end
;TI"
;TI"$class Car < ActiveRecord::Base
;TI", belongs_to :corporation, touch: true
;TI" end
;TI"
;TI"B# triggers @brake.car.touch and @brake.car.corporation.touch
;TI"@brake.touch
;T;
0o;
; [I"FNote that +touch+ must be used on a persisted object, or else an ;TI"3ActiveRecordError will be thrown. For example:;T@o;; [I"ball = Ball.new
;TI"<ball.touch(:updated_at) # => raises ActiveRecordError;T;
0:
@fileI"%lib/active_record/persistence.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(*names, time: nil);T@5FI"Persistence;TcRDoc::NormalModule00