On Sat, May 30, 2009 at 10:38 AM, Jonathan Rochkind <
rails-mailing-l...@andreas-s.net> wrote:

>
> Conrad Taylor wrote:
> > An Array instance can respond to both count and size methods.  If you
> > use
> > size the method with a counter
> > cache column on the has_many side, you can cache the total.
>
> You can't possibly mean an Array, because an Array doesn't know anything
> about going to databases or cacheing.  An Array is just a list of stuff.
>
> You might mean an ActiveRecord Association collection object, which
> behaves a lot like an array, but also has some 'magic' ActiveRecord
> behavior on it.
>
> The fact that, as far as I know, there's no actual class name for this
> AR association magic collection object, makes things rather confusing, I
> agree. I think it's just some proxy methods singleton-added to an Array,
> leaving us without a good name to call what it is, making things
> confusing. Or if it really is a class, I don't know what it's called
> cause it's not mentioned in the docs. This is a kind of a-bit-too-clever
> ruby hacking that Rails, IMHO, uses sometimes when it doesn't really
> have to, making things somewhat more confusing than they need to be.


In regards to a counter cache column, I'm referring to an ActiveRecord::Base
association as I indicated in my example.

-Conrad


>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to