Understanding the Data Model

I’ve made decisions about how we’re modeling our universe that will have consequences for our code structure throughout our application. Our application starts with a relatively simple data model with the following four ActiveRecord models:

  • Event—Something you might buy a ticket to see, such as Julius Caesar or Much Ado About Nothing. Right now, events have only a minimal set of attributes: a title, description and an image_url.

  • Performance—A specific date and time that an event is performed. The way the data is structured, a performance is what you actually buy tickets for. A performance belongs to an event, and it has a start and end time.

  • Ticket—What a user actually purchases, which is the right to a seat ...

Get Take My Money now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.