[Rails] Re: Trivial SQL query - how to do it with ActiveRecord?

2011-08-19 Thread timeon
Hi, On Aug 18, 7:08 pm, Dheeraj Kumar wrote: > A classic HABTM! Yes indeed - and Thank You! Solved the problem. I got confused by the picture on the association basics -section: I thought Appointment was the high level item "owning" Patients and Physicians, like what one would draw in an UML dia

[Rails] Trivial SQL query - how to do it with ActiveRecord?

2011-08-18 Thread timeon
Hi, I've been trying to read ActiveRecord tutorials etc. but haven't figured out how to get the information I want. Let's say I have a users who own one to many bookshelves and some of these bookshelves contain books. Now I would like to get a list of books that belong to us