So I'm having a problem modeling this in Mongo/Mongoid:
Teams can participate in an event and each event will have results for each team (score, actions leading the the score, etc.) Basically I want to display a scoreboard of sorts for the event.
So here is what I have:
Event
has_and_belongs_to_many :teams
Team
field :name
field :color
has_and_belongs_to_many :events
This works fine but I need to know how to model the relationship between each team and the event.
TeamEventStats (probably not the best name)
field :score, :type => Integer
# etc. etc.
In ActiveRecord/RDBMS I could do a through (join) model and go on my merry way but I don't know how to do this in Mongo. Anyone know a good way of doing this or a better way of modeling the relationship?