Sha256: 1c4bc5daa9af2deb9bf8f6b2edb81aee68cf047dec3ab9b03de3d3db9b985034
Contents?: true
Size: 549 Bytes
Versions: 12
Compression:
Stored size: 549 Bytes
Contents
module Smithy class ContentBlockTemplate < ActiveRecord::Base belongs_to :content_block, :touch => true has_many :page_contents validates_presence_of :name validates_uniqueness_of :name, :scope => :content_block_id validates_presence_of :content after_save :touch_page_contents default_scope -> { order(:name) } def liquid_template @liquid_template ||= ::Liquid::Template.parse(self.content) end private def touch_page_contents self.page_contents.each(&:touch) end end end
Version data entries
12 entries across 12 versions & 1 rubygems