I am going through Rail Association tutorial
I expand this model to suit your needs Want to:
Class Doctor & lt; ActiveRecord :: Base has has_many: The placements has has_many: patients ,: through: = & gt; : Appointments and Class Appointments & lt; ActiveRecord :: Base is_to: Doctor belongs_to: Patient & Class patient & lt; ActiveRecord :: Base has has_many: The placements has has_many: practitioners ,: through => : End of appointment How can I make a model that has_many with the Appointments Association physician For example:
class doctor & lt; ActiveRecord :: Base is: Medium: In Placements_MOUN: Available Chances are: Patients, By: = & gt; : Appointment and Class Available Appointments & lt; ActiveRecord :: Base is_to: Doctor End How can I store different time frames in the model? Say that a therapist is available from 8am - 3 PM with 30 minutes (8: 30- 9, 9-9: 30, 9: 30-10) for each appointment ... How do I store this information in db or Available Appointments Model
First of all, I will change the name.
Create incidence events for every 30 minute time slot. You can either pre-populate the program for the physician, or the physician can add them to an admin section. You need this approach for your physician to see your available appointments in any way, because availability Examples of each are unique to the doctor, and doctors can always add / re-add.
Then see appointments one who see the benefits of the physicians. When the appointment is made based on an availability, remove the availability.
Comments
Post a Comment