Sha256: f408c0a1e3b6d8665452552a65950d83e19de765f6a57d3ab4220964ed693c4f
Contents?: true
Size: 530 Bytes
Versions: 87
Compression:
Stored size: 530 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_update(:touch_elements) end private def touch_elements return unless respond_to?(:elements) elements.touch_all end end end
Version data entries
87 entries across 87 versions & 1 rubygems