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.98k stars 1.2k forks source link

Adding tags does not honor arrays #362

Open bigfolio opened 11 years ago

bigfolio commented 11 years ago

The README says the tag_list#add method honors arrays:

@user.tag_list.add("awesomer, slicker") # also works with arrays

But for me it's only adding a single tag (with commas):

1.9.3p286 :024 > image.tag_list
 => ["foo"]
1.9.3p286 :025 > image.tag_list.add "bar,baz,bif"
 => ["foo", "bar,baz,bif"] 

It only works if I add a split and pass it an actual array (but that doesn't jive with the README of course):

1.9.3p286 :026 > image.tag_list.add "bar,baz,bif".split(',')
 => ["foo", "bar,baz,bif", "bar", "baz", "bif"] 

(using version 2.4.0 on Ruby 1.9.3p286)

tilsammans commented 11 years ago

Probably related to ActsAsTaggableOn.force_parameterize.

I will take a look.

mshappe commented 10 years ago

(I'm perusing the issues list as this is a gem I'm thinking of using, so please let me know if I'm retreading old ground).

On the surface, this doesn't look like it's still, or was ever, an issue. The example in the original report was not adding by array, but adding by string, with comma-separated values. Documentation says this requires 'parse: true' as a parameter.

Either way, this is 9 months old. I'm sort of thinking something this key to the gem is not still an issue...