Skip to content

Instantly share code, notes, and snippets.

@SpencerCDixon
Last active August 29, 2015 14:17
Show Gist options
  • Save SpencerCDixon/08a518d283911396f004 to your computer and use it in GitHub Desktop.
Save SpencerCDixon/08a518d283911396f004 to your computer and use it in GitHub Desktop.
Active Record Associations

Active Record Associations

Globo Gym Challenge

After graduating Launch Academy you get a job working for Globo Gym. They want you to build a light-weight, lean, and agile Sinatra application to handle all their memberships. White Goodman understands the importance of using an ORM to model your data and he has concluded that Active Record is the most badass one around. Currently, Globo Gym has over 20 locations and is slowly putting the Average Guys gym out of business. (which is probably why they can afford to hire you)

Create the ER Diagram and associations for Globo Gym's new application. There will be multiple gyms using the application and users memberships are only available at one gym. Think about what types of tables you will need to create this application. Think about what different columns you will need in each table.

Extra Credit

Create the ER Diagram so members have different levels of membership: "standard", "multi-gym", and "ultimate". The standard memberships can only go to one gym, the multi-gym memberships have access to 5 of the gyms that Globo owns, and the ultimate membership gets access to every possible gym. What types of methods would you create in your Models in order to help you with this web application?

Note: This challenge is intentionally left very broad in order to force you to think about the data and what you might want to store. Do your best at creating ER Diagrams and thinking about this SPECIFIC problem domain. Think back to the past when you signed up for a gym membership, what types of information did they have you fill out? Why did they need certain information? Good luck!

Extra Extra Credit (for overachievers)

Build the fucking sinatra app. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment