Class: ActiveRecord::Associations::Builder::HasOne
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- ActiveRecord::Associations::Builder::HasOne
- Defined in:
- lib/active_record/associations/builder/has_one.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Association
Class Method Summary collapse
Methods inherited from Association
Class Method Details
.touch_record(record, name, touch) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/active_record/associations/builder/has_one.rb', line 37 def self.touch_record(record, name, touch) instance = record.send(name) if instance&.persisted? touch != true ? instance.touch(touch) : instance.touch end end |