Read more

Get all associations of an ActiveRecord class

Andreas Robecke
October 31, 2012Software engineer

YourClass.reflect_on_all_associations.map(&:name)

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
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)