Sha256: 055e31984d1f20525cea624f8a231920af48a2bc2c858a8a95ed06daf1829cc5
Contents?: true
Size: 1.01 KB
Versions: 35
Compression:
Stored size: 1.01 KB
Contents
module PandaCms class Block < ApplicationRecord self.table_name = "panda_cms_blocks" belongs_to :template, foreign_key: :panda_cms_template_id, class_name: "PandaCms::Template", inverse_of: :blocks, optional: true has_many :block_contents, foreign_key: :panda_cms_block_id, class_name: "PandaCms::BlockContent", inverse_of: :block validates :kind, presence: true validates :name, presence: true validates :key, presence: true, uniqueness: {scope: :panda_cms_template_id, case_sensitive: false} # Validation for presence on template intentionally skipped to allow global elements # NB: Commented out values are not yet implemented enum :kind, { plain_text: "plain_text", rich_text: "rich_text", iframe: "iframe", list: "list" # image: "image", # video: "video", # audio: "audio", # file: "file", # code: "code", # iframe: "iframe", # quote: "quote", # list: "list" # table: "table", # form: "form" } end end
Version data entries
35 entries across 35 versions & 1 rubygems