orbit-basic/app/models/page.rb

24 lines
378 B
Ruby
Raw Normal View History

class Page < Item
2010-01-08 10:36:36 +00:00
#include LayoutSupport
2010-01-04 07:52:30 +00:00
field :content
field :layout_name
field :layout_id
2010-01-28 09:42:55 +00:00
validates_presence_of :layout_name, :layout_id
referenced_in :layout
2010-01-28 09:42:55 +00:00
2010-02-05 08:53:52 +00:00
protected
def setup_default_value
super
if self.layout_name
self.layout_id = Layout.first(:conditions => {:name => self.layout_name} ).id
2010-02-05 08:53:52 +00:00
end
end
end