On 14 April 2010 12:32, Andy Jeffries <[email protected]> wrote:
> How about using counter caches - something like:
>
> class Customer < Person
>   default_scope :conditions => { :orders_count > 0}
> end
>
> http://guides.rails.info/association_basics.html#belongs-to-association-reference
> (section 4.1.2.4)
> Cheers,
>
> Andy

Nice idea... that would do well, and clean it up a bit - I just tried
my approach (after fixing typos...) and it works, but just smells...
:-)

Thanks for that.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to