ga-wdi-boston/rails-model-validations

Make sure to avoid "orphan records"

Opened this issue · 2 comments

If Lists have many Items. If Items belong to a List, you need to make sure that List has a Item (just like how we would make sure that each item had a primary key).

gaand commented

This doesn't seem correct to me. Why can't a list exist without an item?

Examples: any newly created list; a todo list with all items completed and deleted.

Yeah, @gaand it was just a note to myself. Basically saying that "items" belong to "lists." They're related and therefore can't be created without belonging to a list. A list can certainly exist without items, but not hte other way around.