2010-09-10 11 views

Répondre

11

Vous pouvez utiliser Reflections Active Record (API here)

Dans votre exemple:

p.class.reflect_on_all_associations(:has_many).collect {|a| a.name}