In this exercise we are going to explore the has_many through relationship by creating a quick example. The first part of this markdown will be geared toward making a simple example that shows the relationship while the second part will consist of expanding the simple app to show the relationships in the browser.
We are going to use doctors and patients for this example.
As you could have guessed a doctor can have many patients and a patient can have many doctors. One way that we could facilitate this many to many relationship is by using an "associative table". We can call our associative table "appointments", which should help us make it easier to understand the relationship between doctors and patient.