TelescopeJS/Telescope — pull request #489 by steffenstraetz (2014-10-15 20:25:47+00:00)
Title: View and click counting addition / cleanup

I am working on a new theme for telescope in which I also want to show the number of views for each post. That´s why I decided to add "viewsCount" to the post schema (increases +1 per user/session/view). On my way through the code, I noticed that the parts for click and comment counting could also benefit from some cleanup / refactoring so that all "counters" follow a similar naming pattern.

OLD:
clicks
commentCount (user)
commentsCount (post)

NEW:
clicksCount
viewsCount
commentsCount

I fixed also some smaller bugs that user commentCount would not show correctly in the user list and a potential security issue in the client code for click counting (client could potentially set clicksCount to any value).

I added also migration methods for the changes that I made to the post and user schema.