mbleigh/acts-as-taggable-on — pull request #236 by chrismhilton (2012-02-29 09:00:11+00:00)
Title: Preserve the order in which tags are created

This commit adds acts_as_ordered_taggable methods to use when you want to preserve the order in which tags are created.

For example, using the new methods means that when an object's tag_list is updated from [4,5,6] to [3,6,9] a subsequent fetch of the object's tag_list will return [3,6,9] and also the tags association will return tag objects in the same order.

The new methods set the attribute preserve_tag_order to true and consequently (1) when saving tags, the taggings are created in the order in which the tags appear in the tag list; (2) when fetching tags by context for the tag lists they are ordered by tagging created_at; (3) an order option is added to the tag context associations (so that for a 'tags' context the associations tag_taggings & tags are always returned in tagging created_at order)