Found my answer here:
http://gilesbowkett.blogspot.com/2007/12/activerecordbasereflectonallassociation.html
On Feb 14, 11:20 am, Brian Butz
<butzopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I feel like this might be a very simple problem and something just
> isn''t catching my eye in the API.
>
> I''m writing a sort of verification form that allows you to add
> individual fields to verify single attributes from the original form.
> Each attribute has search conditions associated with it based on its
> type, and I need to lookup what kind of classes the object from the
> form ''has_many'' and ''belongs_to'' has.
>
> I imagine there''s something as simple as:
>
> Blog.has_many_associations
> => [''users'', ''posts'']
> Post.belongs_to_associations
> => [''user'', ''comment'',
''blog'']
>
> Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---