Read more

Get all associations of an ActiveRecord class

Andreas Robecke
October 31, 2012Software engineer

YourClass.reflect_on_all_associations.map(&:name)

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Get the class name by calling class_name, or the type of the association (belongs_to, has_many,...) by calling macro

Posted by Andreas Robecke to makandra dev (2012-10-31 20:37)