Rails Active Record Associations
Associations between database tables is incredibly important. I’ve been working on a volunteer tracking app for nonprofits that has several tables and many associations. I found out the hard way why you should always choose the has_many through association instead of the has_and_belongs_to_many_association (habtm). I…
Polymorphic Associations
Had my first interview with Thoughtbot today. The interviewer asked me a question about how I would handle having comments for different objects in a discussion board (Posts, Images, Articles). My answer was to have a bunch of foreign keys under a comments model/table. …