I have three tables:
One for user that stores login information of user and its column are
name,email,password,roleandid.roleis to tell whether he is adoctororpatientor anadmin.Next table is
Patienttable that only storeidand other info of patient exceptnameandemailidandpassword. To create a relationship theidof this table depends onidofUsertable to getnameandemail.My last table is
Doctortable that also storeidand other info of doctor. Here also theiddepends uponUsertableidcolumn .
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