opengovernment/askthem — pull request #167 by derekeder (2013-10-11 20:46:32+00:00)
Title: Question sorting

Implemented question sorting filters, closes #124

On the questions page, we can now sort by

* `need signatures` - questions that have yet to meet their signature threshold
* `have answers` - questions that have been officially answered
* `need answers` - questions that have not been answered
* `recent` - all questions, sorted by most date posted, descending

To implement `need signatures` we created a boolean flag `threshold_met?` and added some logic to set it whenever a signature is added to a question.

For the filter logic, we decided to follow the same `tab` pattern used on other pages, and created `filter_options` in `application_helper` for rendering.

Also, wrote specs for all 4 filters, as well as the new `threshold_met?` logic.