On Mar 7, 6:08 pm, Tod Tod <rails-mailing-l...@andreas-s.net> wrote:
>
> I'm just trying to investigate why it is not chained whole over all
> associations. I think that each association shuold act as maybe proxy
> and pass from begining Shop.find(1) till the end of this chainings and
> pass Shop record.
>
> It sounds to me naturally way of living this kind of chainging. But I is
> it is not.
>
> I'm just guessing but I think this kind of behaviour is in DataMapper,
> am I right?
>
don't know about DataMapper. In activerecord as soon as you call find
you'll get a normal record/array of records. if you just want
something that adds some extra conditions then you may be interested
in named_scope. The other thing is that (in active record) scopes
scope a particular table, so when you do Shop.find(1).categories then
the categories proxy there is scoping finds on Category to those with
the appropriate shop_id - it's not magic thing across everything with
a shop_id column.

Fred


Fred


--~--~---------~--~----~------------~-------~--~----~
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