This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/layout.rb

14 lines
368 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 => /^[0-9a-zA-Z\-_]+$/
validates_uniqueness_of :name
end