Sha256: 57ebc9e2018ee91462fd26b3e792089f5005cfd32610ecad8685594e0b0c454a
Contents?: true
Size: 531 Bytes
Versions: 48
Compression:
Stored size: 531 Bytes
Contents
# frozen_string_literal: true module Alchemy # If the model has a +elements+ association, # it updates all their timestamps after save. # # Should only be used on bottom to top relations, # e.g. +Alchemy::Picture+ or +Alchemy::Attachment+ # not on top to bottom ones like +Alchemy::Page+. # module TouchElements def self.included(base) base.after_save(:touch_elements) end private def touch_elements return unless respond_to?(:elements) elements.map(&:touch) end end end
Version data entries
48 entries across 48 versions & 1 rubygems