I am making a rails site where you can schedule an appointment for a service. Currently I have an Appointment and Client model. Now I have decided that in order to get the Client’s information (name, email, etc) from an Appointment object, I would make an association between the two models. Now the way I see it, an Appointment should have_one client and a Client should have_many appointments. However, I have never seen an association between two model where they both have have_x associations. So what I am wondering is this is possible, will it work? Also is there a better way to do this, maybe something I’m missing? Any insight would be much appreciated!
I am making a rails site where you can schedule an appointment for a
Share
I don’t believe that will work. You may want to use the
belongs_tomethod to associate yourAppointmentto yourClient: