universal_table/app/models/u_table.rb

15 lines
404 B
Ruby
Raw Normal View History

2015-11-13 13:10:00 +00:00
class UTable
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCategory::Categorizable
include Slug
field :title, as: :slug_title, localize: true
has_many :table_columns, :dependent => :destroy
has_many :table_entries, :dependent => :destroy
accepts_nested_attributes_for :table_columns, :allow_destroy => true
FIELD_TYPES = ["text", "editor", "image", "date", "period"]
end