2009/10/3 Denis Denis <[email protected]>:
>
> Hi,
>
> Considering this:
>
> @article = Article.first(:joins => :category)
>
> Does ActiveRecord provides a generique method such as .parent to call
> the @article category? Something like @article.parent which is the same
> as @article.category

An Article could belong_to several models, so you could have
@article.category and @article.magazine.  How would @article.parent
know which 'parent' to use?

Colin

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