PERF: store topic views in a topic view table

* cut down on storage of the work Topic, 3 times per row (in 2 indexes)
* only store one view per user per topic
* only store one view per ip per topic
This commit is contained in:
Sam
2014-08-04 19:07:55 +10:00
parent 0ccb8e17cb
commit cb0ecd9ff1
16 changed files with 117 additions and 79 deletions

View File

@ -587,7 +587,7 @@ describe TopicsController do
end
it 'records a view' do
lambda { xhr :get, :show, topic_id: topic.id, slug: topic.slug }.should change(View, :count).by(1)
lambda { xhr :get, :show, topic_id: topic.id, slug: topic.slug }.should change(TopicViewItem, :count).by(1)
end
it 'records incoming links' do