Context: I used single table inheritance to set up my User model, which has an attribute ‘type’ that assigns a class type (Tutor or Student) to a newly created instance. The idea is that I wanted to have a many to many relationship between Tutors and Students through Appointments (which has a belongs to relationship with both). In the case of this application, both types of Users are going to have the same core functionality (name, email, password, etc), but each will also have their own unique attributes, and (depending on their class type) will have access to a limited scope of the application. For a more in depth look at the setup, here is the previous blog I wrote about this table and model structure: https://etcusic.github.io/sti_mti_and_different_types_of_users)
The aspect of software development that I am most interested in is the structure of a code base and the best practices on how to structure the code as simply and efficiently as possible. I had a bit of trouble initially setting up my controllers and routes in this project, so I figured I’d write about what I learned sorting through its structure.
For my project I began with a data scrape from NFL Network’s homepage to get information from each team in order to structure classes that represent different levels of organization: League, Team, Player. Getting data all the way down to the player data was a bit tricky, especially if I was going to do it as efficiently as possible.
Ok - the title may be a bit cliche, but it just seemed too appropriate not to.