mbleigh/acts-as-taggable-on — Issue #227: Mysql2::Error: Duplicate entry 'şi' for key 'index_tags_on_name' on diacritic letters
Author: infoman
Created: 2012-02-03 22:20:54+00:00
State: open

I have a tags table in my database with tag name column marked as unique index (as I do not want to have two identical tags).

When I run a script importing multiple different objects with many different tags there's an issue that mysql counts the diacritic and non-diacritic versions of one letter (for example, s and ş) the same, but this gem still tries to add a new tag (even when 'select * from tags where name = 'şi' returns one record with tag 'si').

The same error also occurs when providing an array with non-unique records as tags_list.

Possible fix can be to catch ActiveRecord::RecordNotUnique exception and then use the tag returned by select.