On Mar 21, 6:23 pm, Gabriele Tassoni <[email protected]>
wrote:
> Hi,
> I was wondering if there's a way to know the associations needed to
> reach a model from another, i.e.
> I have a Customer, I know it has some Invoices, each of these has more
> InvoiceRows which belongs to an InvoiceRowDescription, I would like to
> know if there's a way to automagically build something like this (for
> an auto generated named scope's join key):
>

There's not something builtin (although it does sound like it would be
a relatively simple graph traversal exercise to produce something like
this (picking the 'best' path if there were multiple ones might be
trickier)).

Fred
> {:invoices => {:invoice_rows => :invoice_row_description}}
>
> knowing just that the current model is Customer, and the last model is
> InvoiceRowDescription
>
> Thanks,
>
> G.
--~--~---------~--~----~------------~-------~--~----~
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