module ActiveRecord::TouchLater

Active Record Touch Later

Private Instance Methods

belongs_to_touch_method() click to toggle source
# File lib/active_record/touch_later.rb, line 53
def belongs_to_touch_method
  :touch_later
end
has_defer_touch_attrs?() click to toggle source
# File lib/active_record/touch_later.rb, line 49
def has_defer_touch_attrs?
  defined?(@_defer_touch_attrs) && @_defer_touch_attrs.present?
end
surreptitiously_touch(attrs) click to toggle source
# File lib/active_record/touch_later.rb, line 37
def surreptitiously_touch(attrs)
  attrs.each { |attr| write_attribute attr, @_touch_time }
  clear_attribute_changes attrs
end
touch_deferred_attributes() click to toggle source
# File lib/active_record/touch_later.rb, line 42
def touch_deferred_attributes
  if has_defer_touch_attrs? && persisted?
    touch(*@_defer_touch_attrs, time: @_touch_time)
    @_defer_touch_attrs, @_touch_time = nil, nil
  end
end