クエリを介してhas_manyにいくつかの問題があります。
ここでの例の使用: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
Appointmentテーブルには、appointment_dateという名前の列があります
特定の日に予約を入れている特定の医師からすべての患者を取得するにはどうすればよいですか?