I have three tables:
One for user that stores login information of user and its column are
name
,email
,password
,role
andid
.role
is to tell whether he is adoctor
orpatient
or anadmin
.Next table is
Patient
table that only storeid
and other info of patient exceptname
andemailid
andpassword
. To create a relationship theid
of this table depends onid
ofUser
table to getname
andemail
.My last table is
Doctor
table that also storeid
and other info of doctor. Here also theid
depends uponUser
tableid
column .
My question is how to create this relation in ruby on rails?
I am just a starter with ruby on rails and I am using sqlite db
Aucun commentaire:
Enregistrer un commentaire