title: Events with multiple dates do I use has_and_belongs_to_many
body: <p>Users can create multiple day events.</p>
  
  <p>So an event can have multiple dates, including a start time and end time for the date.</p>
  
  <p>So an event might have these dates:</p>
  
  <p>July 1 2013 9:00am - 5:00pm
  July 2 2013 10:00am - 6:00pm
  July 7 2013 1:00pm - 5:30pm</p>
  
  <p>So the event table would store the event id, event name, the type of event, address fields for where the event will be held, etc. But how do I model the multiple dates for the event? I could have a separate event_dates table, and that table would have multiple rows for each event:</p>
  
  <p>id        event_date      event_start_time     event_end_time
  event1    July 1 2013     9:00am               5:00pm
  event1    July 2 2013     10:00am              6:00pm
  event1    July 7 2013     1:00pm               5:30pm</p>
  
  <p>But I would also like to query for events occurring on a day (regardless of time), so users could find events in their area that occur on certain days (they might visit multiple events that day).</p>
  
  <p>So how would I model this? Would I use has_and_belongs_to_many, where one event has multiple dates, and one date has multiple events? </p>
  
  <p>In the view, when saving the event, I guess I need to save the event data to the events table, and also save the date/time combination to the other table. But to save the date/time combination to the other table, I need the id for the event that was just saved. So in one form I have a dependency such that the first save must succeed (save event), for the second save to proceed (save date/time using new event id).</p>
  
  <p>Thanks for your help in advance.</p>