How to get all records from a nested activerecord collection <p>I have an ActiveRecord query that i need help with.</p> <p>Lets say we have a user and he has multiple libraries. In each library, there are many collections. In each collection, he has many books.</p> <p>How do I get a list of all his books?</p> <p>I know I can do libraries.each |library| library.collections.each do |collections| collection.books.each do |book| books &lt;&lt; book.title</p> <p>but I'm hoping for a simpler methodology then this.</p>