0
在Rails 3.2中,關聯選項counter_cache
與其他選項鍊接,如counter_sql
或conditions
?計數器緩存尊重counter_sql或條件?
舉例來說,如果我有這樣的關聯:
class User
has_many :items, :through => :orders
has_many :active_items, :through => :orders
:conditions => 'active = true', :source => :item
class Order
belongs_to :users, :counter_cache => :active_items_count
belongs_to :items
class Item
has_many :users, :through => :orders
會將反緩存就該活躍條件? (意思是不活動的項目將不計算在內) 又是怎麼回事使用finder_sql
/counter_sql