diaspora/diaspora — pull request #3434 by Raven24 (2012-07-04 21:07:57+00:00)
Title: make the rake task for cleaning up mixed-case tags more verbose

I have noticed, that the rake task I wrote for cleaning up mixed/upper-case tags doesn't handle the situation correctly when a taggable is associated with both the lowercase and the wrongly-cased variant of a tag already. The taggings were not modified and both tags were kept in the database - which is not desireable.

Now it also correctly downcases tag names with multi-byte uppercase letters (ÄÖÜ.....) the same way it is done in the acts_as_taggable_on gem.

It also checks, if there are any taggings left for an "evil" tag, and if not, it will delete the tag. So running the second rake task just for that should be obsolete.
If, after all the processing, there are still taggings left for the "evil" tag, it will abort, because then it encountered a situation which should not occur - to my knowledge...
But let's assume it does what it's supposed to.

It should be safe to just run the rake task again:

bundle exec rake migrations:rewire_uppercase_hashtags

**Please review and test on copies of your database**
Hopefully with that all tags will be lowercase again...

#3310