mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.97k stars 1.2k forks source link

Duplicate Tag error #1055

Open rctneil opened 2 years ago

rctneil commented 2 years ago

Hi,

I'm importing some data into my app that should add tags to some imported items.

I'm getting some ActsAsTaggableOn::DuplicateTagErrors, with messages like "'Tag here' has already been taken" .

Any ideas why this may be?

Surely that tag would just be assigned to the new item and not try to be created, which is what it looks like it's doing?

My code for adding the tags is as follows:

            # Add tags for Park name and Park name with Location 1
            park.tag_list.add(park.name) # Normal tag
            park.tag_list.add(park.name + ' ' + park.location_1) # Allows finding by tag if more than one park with same name
            park.tag_list.add('pl-' + park.name + ' ' + park.location_1)
            park.save
rctneil commented 2 years ago

@mbleigh Looks like this may be related to https://github.com/mbleigh/acts-as-taggable-on/issues/672

Is there any chance of a fix to this? It is seriously preventing me from the continuation of my app etc.

Many thanks in advance!!