Fix slow impressionist count
This commit is contained in:
parent
7022adc11f
commit
f3bb20ee45
|
@ -3,14 +3,14 @@ class Page < Item
|
||||||
include Impressionist::Impressionable
|
include Impressionist::Impressionable
|
||||||
include ParserFrontEnd
|
include ParserFrontEnd
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable
|
||||||
|
|
||||||
field :content, localize: true
|
field :content, localize: true
|
||||||
field :app_frontend_url
|
field :app_frontend_url
|
||||||
# field :theme_id, :type => BSON::ObjectId, :default => nil
|
# field :theme_id, :type => BSON::ObjectId, :default => nil
|
||||||
field :category,type: Array, :default => []
|
field :category,type: Array, :default => []
|
||||||
field :tag, type: Array,:default => []
|
field :tag, type: Array,:default => []
|
||||||
field :view_count, :type => Integer, :default => 0
|
# field :view_count, :type => Integer, :default => 0
|
||||||
field :page_title, localize: true
|
field :page_title, localize: true
|
||||||
|
|
||||||
field :frontend_style
|
field :frontend_style
|
||||||
|
@ -65,6 +65,10 @@ class Page < Item
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def view_count
|
||||||
|
self.impression_count
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def create_parts
|
def create_parts
|
||||||
|
|
Loading…
Reference in New Issue