orbit-basic/app/models/page.rb

24 lines
378 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
protected
def setup_default_value
super
if self.layout_name
self.layout_id = Layout.first(:conditions => {:name => self.layout_name} ).id
end
end
end