title: Rails Active Record Associations: fetch data from multiple table
body: <p>I have tables in db as following migration script:</p>
  
  <pre><code>class CreateAppointments &lt; ActiveRecord::Migration
    def change
      create_table :physicians do |t|
        t.string :name
        t.timestamps null: false
      end
  
      create_table :patients do |t|
        t.string :name
        t.timestamps null: false
      end
  
      create_table :appointments do |t|
        t.belongs_to :physician, index: true
        t.belongs_to :patient, index: true
        t.datetime :appointment_date
        t.timestamps null: false
      end
    end
  end
  </code></pre>
  
  <p>And the model class looks like:</p>
  
  <pre><code>class Physician &lt; ActiveRecord::Base
    has_many :appointments
    has_many :patients, through: :appointments
  end
  
  class Appointment &lt; ActiveRecord::Base
    belongs_to :physician
    belongs_to :patient
  end
  
  class Patient &lt; ActiveRecord::Base
    has_many :appointments
    has_many :physicians, through: :appointments
  end
  </code></pre>
  
  <p>I'm able to pick all patients data of specific physician using:</p>
  
  <pre><code>patients = Physician.find(123).patients
  </code></pre>
  
  <p>The problem is, I need appointment_date, which is stored in appointment table, along with patient details. Somehow I'm not able to figure out how to fetch it.  </p>