I'm working on an event site where users have items in their inventory that can be listed in their profile. For this I am using:
has_many :items
in my user.rb.
A user would then be able to attend any number of events. For each event, they would have a unique items list, i.e., items to bring to the event. I'm trying to figure out the associations in order to make this work.
In item_list.rb:
belongs_to :event
belongs_to :user
has_many :items
In item.rb:
belongs_to :user
belongs_to :item_list
In event.rb
has_many :item_lists
But what's baffling me is making sure that each list is unique to each event and user. Additionally, would my migration for item_list
include an array of items?
Any insight would be appreciated.