When setting up the appointments association you need to manually specify the foreign key column:
class Physician < User
has_many :appointments, foreign_key: :physician_id
has_many :patients, through: :appointments
end
class Patient < User
has_many :appointments, foreign_key: :patient_id
has_many :physicians, through: :appointments
end
Also make sure you have added a type
column to users to get single table inheritance working.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…