In the console this code:
Patient.joins(:notes,:recordings).find(1)
Returns
ActiveRecord::RecordNotFound: Couldn't find Patient with id=1
Which is bizarre because in the same console Patient.find(1)
works without any issue and retrieves the record of the patient with id 1.
My understanding is that I should be able to do:
a = Patient.joins(:notes,:recordings).find(1)
a.notes
a.recordings
And a.notes should return all the notes associated with the patient with id 1 and same for a.recordings. It's clear I'm missing something here...any ideas?