2010-01-14 10:30:53 +00:00
|
|
|
class Page < Item
|
2010-01-08 10:36:36 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
#include LayoutSupport
|
2010-01-04 07:52:30 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
field :content
|
|
|
|
field :layout_name
|
|
|
|
field :layout_id
|
2010-01-28 09:42:55 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
validates_presence_of :layout_name, :layout_id
|
|
|
|
|
|
|
|
referenced_in :layout
|
2011-05-18 02:00:00 +00:00
|
|
|
has_many :page_parts
|
2010-01-28 09:42:55 +00:00
|
|
|
|
2010-02-05 08:53:52 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
def setup_default_value
|
|
|
|
super
|
|
|
|
|
2011-03-01 07:58:42 +00:00
|
|
|
if self.layout_id
|
|
|
|
self.layout_name = Layout.find(layout_id).name
|
2010-02-05 08:53:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-03-01 07:58:42 +00:00
|
|
|
end
|