Removed impressionist counter cache
This commit is contained in:
parent
8e89a1647d
commit
a7005c6e8b
|
@ -16,7 +16,7 @@ class Bulletin
|
||||||
# include Tire::Model::Search
|
# include Tire::Model::Search
|
||||||
# include Tire::Model::Callbacks
|
# include Tire::Model::Callbacks
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable
|
||||||
|
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :subtitle, localize: true
|
field :subtitle, localize: true
|
||||||
|
@ -158,6 +158,10 @@ class Bulletin
|
||||||
User.find(self.email_user_ids) rescue []
|
User.find(self.email_user_ids) rescue []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def view_count
|
||||||
|
Impression.where(:impressionable_id=>self.id).count
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
# def clean_values
|
# def clean_values
|
||||||
|
|
Loading…
Reference in New Issue