Open Yorkshireman opened 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 =>
Change
WordlistEntryCategory
toWordlistEntryCategoryList
, or maybe even justCategoryList
?