0
我使用以下gem,现在我试图根据视图数量对帖子进行排序。印象派宝石 - 按意见排序帖子
我按照说明书,在我的岗位模型,所以我有:
is_impressionable :counter_cache => true
而在我的控制,我有:
@mostpopular = @posts.order('counter_cache DESC').limit(6)
但我发现了一个错误:
SQLite3::SQLException: no such column: counter_cache: SELECT "posts".* FROM "posts" ORDER BY counter_cache DESC LIMIT 6