simeonwillbanks/mygists — pull request #37 by simeonwillbanks (2013-01-24 19:02:02+00:00)
Title: Tags pagination refactored to only include public tags

Fixes #36

* Refactor `ActsAsTaggableOn::Tag.public_tags` to find distinct public tags via a subselect instead of `SELECT DISTINCT` clause
* The subselect is not only faster, but pagination works properly
* Pagination sends the `size` message which was stripping the `SELECT DISTINCT` clause when generating a `SELECT COUNT(*)` query
* Remove `default_scope` since it was adding unnecessary `ORDER BY` clause where it was not needed
* Move the `default_scope` to a normal scope called `ordered_by_slug`
* Only use `ordered_by_slug` where it is needed such as `MyGists::Search`