This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/page.rb

23 lines
468 B
Ruby

class Page < CouchFoo::Base
property :name, String
property :parent_name, String
property :content, String
property :layout_id, String
property :layout_name, String
belongs_to :layout
validates_presence_of :name
before_save :setup_layout_id
def setup_layout_id
if self.layout_name.blank?
self.layout_id = nil
else
self.layout_id = Layout.find_by_name( self.layout_name ).id
end
end
end