search for: uses_count

Displaying 1 result from an estimated 1 matches for "uses_count".

Did you mean: user_count
2006 Jul 11
1
counter_cache, has_many and belongs_to
...ber of associated objects? Wouldnt the has_many association need the counter cache instead since you never know how many records are linked? Maybe I''m just not understanding something, but here is the snippet I am using: class Coupon has_many :coupon_uses, :counter_cache => :uses_count end Now I could just do "coupon.coupon_uses.size" but there will be very large number of associated objects and would rather not even visit the table if I don''t need to. -- Posted via http://www.ruby-forum.com/.