# How can I get a list of all associations from my model

**URL:** <https://www.ruby-forum.com/t/how-can-i-get-a-list-of-all-associations-from-my-model/165217>\
**Category:** Rails\
**Created:** [April 10, 2009, 9:28am UTC](https://www.ruby-forum.com/t/how-can-i-get-a-list-of-all-associations-from-my-model/165217 "2009-04-10T09:28:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kretch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@kretch](https://www.ruby-forum.com/u/kretch)\
**Post date:** [April 10, 2009, 9:28am UTC](https://www.ruby-forum.com/t/how-can-i-get-a-list-of-all-associations-from-my-model/165217/1 "2009-04-10T09:28:23Z")

</div>

Hi All

I have a model defined as follows:

class a\< ActiveRecord::Base  
has\_many :a\_b\_mappings  
has\_many :bs, :through =\> :a\_b\_mappings, :uniq =\> true

has\_many :a\_c\_mappings  
has\_many :cs, :through =\> :a\_c\_mappings, :uniq=\> true

has\_many :a\_d\_mappings  
has\_many :ds, :through =\> :a\_d\_mappings, :uniq =\> true

…

end

I’m trying to find a class method that will enumerate all the classes  
(:bs,:cs,:ds,…) being associated from class a.  
I’m at a loss as to what hooks ActiveRecord provides that would enable  
me to do that.

Thanks much  
Kretch
