Sha256: 2316fa0a151a03e339ff235bb3905833b6b19551757a1e9f8a66d4f52c094093
Contents?: true
Size: 540 Bytes
Versions: 14
Compression:
Stored size: 540 Bytes
Contents
# frozen_string_literal: true module Alchemy module ContentTouching def self.included(base) base.after_update(:touch_contents) end private # If the model has a +contents+ association, # it updates all their timestamps. # # CAUTION: Only use on bottom to top releations, # e.g. +Alchemy::Picture+ or +Alchemy::Attachment+ # not on top to bottom ones like +Alchemy::Element+. # def touch_contents return unless respond_to?(:contents) contents.each(&:touch) end end end
Version data entries
14 entries across 14 versions & 1 rubygems