app/models/page.rb in locomotive_cms-0.0.2.5 vs app/models/page.rb in locomotive_cms-0.0.2.6
- old
+ new
@@ -10,12 +10,11 @@
## fields ##
field :title
field :slug
field :fullpath
field :published, :type => Boolean, :default => false
- field :keywords
- field :description
+ field :cache_expires_in, :type => Integer, :default => 0
## associations ##
belongs_to_related :site
belongs_to_related :layout
embeds_many :parts, :class_name => 'PagePart'
@@ -34,10 +33,11 @@
named_scope :latest_updated, :order_by => [[:updated_at, :desc]], :limit => Locomotive.config.lastest_items_nb
named_scope :index, :where => { :slug => 'index', :depth => 0, :published => true }
named_scope :not_found, :where => { :slug => '404', :depth => 0, :published => true }
## behaviours ##
+ # liquid_methods :title, :fullpath
liquify_template :joined_parts
## methods ##
def index?
@@ -62,9 +62,13 @@
end
end
def url
"http://#{self.site.domains.first}/#{self.fullpath}.html"
+ end
+
+ def to_liquid(options = {})
+ Locomotive::Liquid::Drops::Page.new(self)
end
protected
def do_not_remove_index_and_404_pages
\ No newline at end of file