Sha256: c9936a53b4701a0c92fc4c1c0c7a66cd0d6e254c6cac147bf38c6559f93a408f
Contents?: true
Size: 572 Bytes
Versions: 11
Compression:
Stored size: 572 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(Smithy::AssetLink.fix(self.content)) end private def touch_page_contents self.page_contents.each(&:touch) end end end
Version data entries
11 entries across 11 versions & 1 rubygems