I'm using the following gem and now I'm trying to sort posts by the number of views.
I have followed the instructions and in my post model, so I have:
is_impressionable :counter_cache => true
And in my controller, I have:
@mostpopular = @posts.order('counter_cache DESC').limit(6)
But I'm getting an error:
SQLite3::SQLException: no such column: counter_cache: SELECT "posts".* FROM "posts" ORDER BY counter_cache DESC LIMIT 6