David wrote: > It seems like there may be a rails method for the following situation: > model User > has_many :appointments > > model Appointment > has_one :instruction > belongs_to :user > > model Instruction > belongs_to :appointment > > I would like to do User.Appointments.Instruction and return an array > with instruction objects
Try User :has_many instructions, :through => appointments. I think that will define User#instructions, which should do exactly what you want. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

