I am new to Rails, and trying to make a simple web app.
I generated the following components:
rails generate scaffold user username:string password:string rails generate scaffold appointment doctor:references patient:references and in the appointment model I specified the class for doctor and patient to be users like below
# app/models/appointment.rb class Appointment < ApplicationRecord belongs_to :doctor, :class_name => "User" belongs_to :patient, :class_name => "User" end I left everything else to be the same, by applying rails db:migrate and rake db:test:prepare, I got this error message saying I don't have the table doctor
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: main.doctors But I thought the specification in appointment.rb would do the job for me.
How do I make this work?