Add Page external_link
This commit is contained in:
1 parent
a4c900af4d
commit
32fdf99833
4 files changed
+13
-4
No files matched your search
+3
-2
@@ -5,6 +5,7 @@ class Page < CouchFoo::Base
|
||||
property :content, String
|
||||
property :layout_id, String
|
||||
property :layout_name, String
|
||||
property :external_link, String
|
||||
property :position, Integer
|
||||
property :is_published, Boolean
|
||||
|
||||
@@ -30,12 +31,12 @@ class Page < CouchFoo::Base
|
||||
protected
|
||||
|
||||
def setup_default_value
|
||||
unless self.position
|
||||
if self.position.blank?
|
||||
max_page = Page.last( :use_key => 'position')
|
||||
self.position = (max_page)? max_page.position.to_i + 1 : 1
|
||||
end
|
||||
|
||||
unless self.parent_page_id
|
||||
if self.parent_page_id.blank?
|
||||
self.parent_page_id = "root"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user