Oopss...wrong list :-) This list is meant for discussing development
of the rails framework itself. Please resend this query to
support/help mailing list -
http://groups.google.com/group/rubyonrails-talk
On 11/1/07, Jon Garvin <jgarvin.lists@gmail.com>
wrote:>
> Given the following..
>
> Foo has_many :bars
> Bar has_many ::widgets
> Widget has_many :gadgets
> Gadget has_many :parts
>
> All of the following are now possible...
>
> @foo.bars
> @bar.widgets
> @part.gadget.widget.bar.foo
>
> However, I can''t just do the opposite of that last one...
>
> @foo.bars.widgets.gadgets.parts
>
> and get a full list of every Part associated with @foo.
>
> I know there''s several different ways to get the same information
(i.e.
> Part.find(:all, :include => {:gadget => {:widget => {:bar =>
:foo}}},
> :conditions => [''foos.id = ?,@foo]) ), but I much prefer the
look and
> feel of the syntax "@foo.bars.widgets.gadgets.parts".
>
> I did some googleing for any plugins that might provide this but came up
> empty handed. I also spent some time working on creating a plugin that
> would provide this, but ran into problems and had to go back to get some
> real work done to justify the paycheck.
>
> So, now my questions for the community is...
> 1. Does anyone know of a plugin that already provides this?
> 2. If not, does this seem like it should be possible, or am I missing
> something that makes this fundamentally impossible?
> 3. If it is possible, is it a worthwhile feature that other''s
would find
> useful, or is it a bad idea or not worth the changes required to Rails
> that would be necessary?
>
> Thanks.
>
> --
> http://www.5valleys.com/
> http://www.workingwithrails.com/person/8078
>
>
> >
>
--
Cheers!
- Pratik
http://m.onkey.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---