新手问题 counter scope 要怎么写?

cconev · August 22, 2012 · Last by huacnlee replied at August 23, 2012 · 2305 hits

topic.rb 中有一个 hits counter, counter :hits, :default => 0

我想炮制个 high_hits 出来,没有成功。有人可以指导一下么? scope :high_likes, desc(:likes_count, :_id)

https://github.com/ruby-china/ruby-china/blob/master/app/models/topic.rb

这个没法直接用的,redis-objects 没有把 counter 的数据存入数据库

You need to Sign in before reply, if you don't have an account, please Sign up first.