Rails ActiveRecord Relationships Flowchart
Posted by Corey Ehmke on October 26th, 2008 in Ruby on Rails | Permanent Link | Share/SaveOne of the remarkable things about Rails is how easy it is to create and manage relationships between objects. ActiveRecord provides this powerful and flexible object-relational mapping (ORM) capability.
Even though there are only a handful of methods involved, it can sometimes be a little confusing to newcomers; and even when you’ve got the big picture down, you might need help remembering the small details, like where to put the foreign key.
To that end, I created a simple flowchart that guides you through the process of setting up your ActiveRecord associations. It’s pinned to the wall next to my desk; hopefully you’ll find it a handy reference as well.
Other formats:
- rails_activerecord_relationships_flowchart.pdf (PDF, 61k)
- rails_activerecord_relationships_flowchart.svg (Scalable Vector Graphic, 32k)
Rails ActiveRecord Relationship Flowchart by Corey Ehmke is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Based on a work at www.idolhands.com.

October 26th, 2008 at 10:51 am
Looks good; I’d definitely pass this off to anybody getting their feet we with Rails. It took me a while to burn this information into my brain.