Having some problems with a has_many through query.
Using the example here: http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association
class Physician < ActiveRecord::Base
has_many :appointments
has_many :patients, :through => :appointments
end
class Appointment < ActiveRecord::Base
belongs_to :physician
belongs_to :patient
end
class Patient < ActiveRecord::Base
has_many :appointments
has_many :physicians, :through => :appointments
end
The Appointment table has a column named appointment_date
How would I get all the Patients from a Specific Physician that have an appointment on a given date?