更新counter_cache字段

ActiveRecord::Base.connection.execute("update corps set followers_count = 4 where id = 162")
 
类似这种,如果ActiveRecord中已查出了数据,还需要reload一下更新count,或者手动更新
posted on 2014-04-03 16:17  qinyan20  阅读(216)  评论(0编辑  收藏  举报