Class: ActiveRecord::Associations::Builder::HasOne

Inherits:
SingularAssociation show all
Defined in:
lib/active_record/associations/builder/has_one.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Association

Association::VALID_OPTIONS

Class Method Summary collapse

Methods inherited from Association

build, create_reflection

Class Method Details

.touch_record(o, name, touch) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/active_record/associations/builder/has_one.rb', line 35

def self.touch_record(o, name, touch)
  record = o.send name

  return unless record && record.persisted?

  if touch != true
    record.touch(touch)
  else
    record.touch
  end
end