orbit-basic/app/models/layout.rb

13 lines
331 B
Ruby

class Layout
include MongoMapper::Document
key :name, String, :required => true, :index => true
key :description, String
key_i18n :content, String
many :children, :class_name => "Item", :foreign_key => "layout_id", :dependent => :nullify
validates_format_of :name, :with => /^[a-zA-Z-_]+$/
end