pagecontent/app/models/page_context.rb

27 lines
586 B
Ruby

# encoding: utf-8
class PageContext
include Mongoid::Document
include Mongoid::Timestamps
include Impressionist::Impressionable
is_impressionable :counter_cache => { :column_name => :view_count }
field :update_user_id
field :version, :type => Integer , :default => 0
field :view_count, :type => Integer, :default => 0
field :content, localize: true
field :archived, :type => Boolean, :default => false
# field :current, :type => Boolean, :default => false
belongs_to :page
def pp_object
page.title
end
def title
self.page.title
end
end