mbleigh/acts-as-taggable-on — pull request #355 by rsamoilov (2013-04-24 11:45:20+00:00)
Title: Optimize acts_as_ordered_taggable

Hi there,

I wanted to propose optimization for acts_as_ordered_taggable. It has very wrong behavior.

I've created a simple [gist](https://gist.github.com/rsamoilov/5419220) - when I want to add the tag to my object, logic behind acts_as_ordered_taggable recreates from scratch all taggings. I just wanted to perform such simple operation as adding a tag, but got monstrous sql queries instead.

Initial tags order is being violated in ```Tag#find_or_create_all_with_like_by_name```. I've created fix for this method to preserve tags order.
Also, I added fix to ```save_tags``` methods. It looks pretty complex, but it's the simplest working version I've come up with.

Actually, I believe, that preserving tags order should be the default and only one possible behavior. So, maybe it makes sense to remove acts_as_ordered_taggable at all and move this optimization to acts_as_ordered.