Hi Frederick

Thanks for answer.

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?


Tod




Frederick Cheung wrote:
> On Mar 7, 4:39�pm, Tod Tod <rails-mailing-l...@andreas-s.net> wrote:
>>
>> Logically this kind of chaining
>> Shop.find(2).category.find(10).shop_categories should collect and join
>> appropriate associations and return data only for shop 2.
> 
> That''s not really how it works - once you do that find(10) you get a
> perfectly ordinary instance of Category (ie the stop_categories is
> just scoped to the category - not the shop.
> 
> I'm not sure why you're doing this at all - why not Shop.find
> (2).shop_categories.find_by_category_id(10) (or
> find_all_by_category_id if you want all of them)
> 
> Fred

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