Sha256: 3981d43a290c96970c2cf99d5b75848667c13938823a526a002154e9de5efa18

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

class Caboose::BlockType < ActiveRecord::Base
  self.table_name = "block_types"

  belongs_to :block_type_category
  belongs_to :parent, :foreign_key => 'parent_id', :class_name => 'Caboose::BlockType'
  has_many :children, :foreign_key => 'parent_id', :class_name => 'Caboose::BlockType', :dependent => :destroy    
  attr_accessible :id,
    :parent_id,
    :name, 
    :description,
    :block_type_category_id,
    :use_render_function,
    :use_render_function_for_layout,
    :allow_child_blocks,
    :render_function,
    :field_type, 
    :default, 
    :width,
    :height, 
    :fixed_placeholder, 
    :options,
    :options_function,
    :options_url
    
  def render_options(empty_text = nil)    
    return eval(self.options_function)    
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caboose-cms-0.4.5 app/models/caboose/block_type.rb
caboose-cms-0.4.4 app/models/caboose/block_type.rb