Orbit/app/models/page.rb

26 lines
369 B
Ruby

class Page < Item
#include LayoutSupport
field :content
field :layout_name
field :layout_id
validates_presence_of :layout_name, :layout_id
referenced_in :layout
has_many :page_parts
protected
def setup_default_value
super
if self.layout_id
self.layout_name = Layout.find(layout_id).name
end
end
end