Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- authors = Author.includes(:published_books)
- authors.map do |author|
- {
- author: author.name,
- books: author.published_books.map(&:name)
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement