IdolHands.com :: Days in the Life of an Alpha Geek
One 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 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.
![]()
Brad Gessler
October 26, 2008 at 5:51 AMLooks 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.