I have some code here
class group < ActiveRecord::Base
has_many :memberships, :dependent => :destroy
has_many :members, :through => :memberships, :source => :person
:conditions => ['memberships.pending = ? ', false]
......
now, I want add a counter_cache for members. Because of the conditions schema, I can't add counter_cache on memberships instead of members. But class person does not belong_to groups, it has_many memberships and memberships belong_to groups. Where should I add the :counter_cache schema ?
or how can I implememt the requirement : add a counter_cache for membership
Thx