2010-01-14 10:30:53 +00:00
|
|
|
class Page < Item
|
2010-01-08 10:36:36 +00:00
|
|
|
|
2010-01-14 10:30:53 +00:00
|
|
|
include LayoutSupport
|
2010-01-04 07:52:30 +00:00
|
|
|
|
2010-01-14 10:30:53 +00:00
|
|
|
key_i18n :content, String
|
|
|
|
key :layout_name, String, :required => true
|
2010-02-05 08:53:52 +00:00
|
|
|
key :layout_id, ObjectId, :required => true
|
2010-01-28 09:42:55 +00:00
|
|
|
|
|
|
|
belongs_to :layout
|
|
|
|
|
2010-02-05 08:53:52 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
def setup_default_value
|
|
|
|
super
|
|
|
|
|
|
|
|
if self.layout_name
|
|
|
|
self.layout_id = Layout.find_by_name( self.layout_name ).id
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2009-05-07 17:18:16 +00:00
|
|
|
end
|