engine/app/models/locomotive/editable_element.rb

29 lines
790 B
Ruby
Raw Normal View History

module Locomotive
class EditableElement
include ::Mongoid::Document
## fields ##
field :slug
field :block
2012-01-25 21:07:10 +00:00
field :default_content, :localize => true
field :default_attribute
field :hint
2012-01-25 21:07:10 +00:00
field :priority, :type => Integer, :default => 0
field :disabled, :type => Boolean, :default => false
field :assignable, :type => Boolean, :default => true
field :from_parent, :type => Boolean, :default => false
## associations ##
embedded_in :page, :class_name => 'Locomotive::Page', :inverse_of => :editable_elements
## validations ##
validates_presence_of :slug
## scopes ##
scope :by_priority, :order_by => [[:priority, :desc]]
## methods ##
end
end