DEV Community

Discussion on: Beginners guide to Active Record

Collapse
 
betalantz profile image
Lantz Warrick

This is a good introduction to migrations and schema, though it's a little strange to be creating a table :haunted_houses in a migration titled CreateCats. When you get to associations, things get confusing. Because you've made ShoeStore the join model between a Shoe and a Brand, it's a child of both a Shoe instance and a Brand instance, i.e. a particular store cannot exist independently of a particular shoe and brand. This relationship bears no logical relationship to the real-world domain it is modeling and is thus confusing. A more logical relationship using these models might look like: ShoeStore -< InventoryItem >- Shoe >- Brand