Sha256: 406b1cf9f27a26783daaea38805bc9e609af9003483b4b0b6a6efaf8cac4306d
Contents?: true
Size: 828 Bytes
Versions: 9
Compression:
Stored size: 828 Bytes
Contents
require_relative '../../app/models/kuhsaft/placeholder_brick' module Kuhsaft module TouchPlaceholders def self.included(base) base.extend(ClassMethods) base.class_eval do after_save :touch_placeholders end end def touch_placeholders return unless self.class.placeholder_templates.present? self.class.placeholder_templates.each do |template_name| related_templates = Kuhsaft::PlaceholderBrick.where(template_name: template_name) related_templates.each { |p| p.touch } if related_templates end end module ClassMethods def placeholder_templates(*attributes) if attributes.empty? @shoestrap_placeholder_templates else @shoestrap_placeholder_templates = attributes end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems