reshleman/craigstr — pull request #15 by reshleman (2014-08-07 18:32:10+00:00)
Title: Admins can view posts flagged as spam

* Add link to application layout for admins
* Add admin dashboard route and controller
* Create admin dashboard view that lists all posts flagged as spam
* Add "flagged" scope for spam-flagged posts to Post model

https://trello.com/c/geKV3o7a

Note: The "flagged" scope finds all posts with spam flags by joining the `posts` and `spam_flags` tables. Because this kind of join returns duplicates, we ask for the count of flags, grouped by the post id. Finally, we order by the number of flags in decreasing order, then by the post's `updated_at` datetime, in reverse chronological order.