Yorkshireman / my_wordlist_resources_spike

Project board: https://github.com/users/Yorkshireman/projects/1
0 stars 0 forks source link

Create Categories #3

Open Yorkshireman opened 5 years ago

Yorkshireman commented 5 years ago

Change WordlistEntryCategory to WordlistEntryCategoryList, or maybe even just CategoryList?

Yorkshireman commented 5 years ago

Or could you have word has_and_belongs_to_many :categories, and category has_and_belongs_to_many :words. This might be better, since you could still access Wordlists that the category is on by doing category.words.map { |word| word.wordlist_id } #=> [ <wordlist_ids> ]

The question between these two patterns is mainly, "Will I need to interact with the intervening model i.e. CategoryList? I can't think of any attributes I'd need to give CategoryList, so maybe there isn't a need for has_many :through =>