This view shows a list of authors along with their newest post and the date that it was published. But it does so using N+1 queries.
View the source code:
Author | Newest Post | Published |
---|---|---|
J.D. Salinger | Franny and Zooey | 1961-01-01 |
Jane Austen | Persuasion | 1817-01-01 |
Charles Dickens | Barnaby Rudge | 1841-01-01 |
This Ruby on Rails app demonstrates the concepts encompassed in a series of blog posts about Greatest Per Group queries in Rails. You can view the source code on Github.