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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs