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

Removing the 255 character limit on tags #635

Open constantm opened 9 years ago

constantm commented 9 years ago

Not sure if I'm missing something, but how does one remove the 255 character limit imposed on tags?

https://github.com/mbleigh/acts-as-taggable-on/blob/1c257ad9f69e7c54fa6615160238ff929d23ba9f/lib/acts_as_taggable_on/tag.rb#L15

rikettsie commented 9 years ago

Hi @constantm As you can see from the first migration 1_acts_as_taggable_on_migration.rb the declared type for a tag 'name' is string (without an explicit limit), this being transformed by Rails into a varchar column (255 characters max) for both Postgres and MySql and this is the reason of the validation you spotted for the tag 'name' field. If you think you need a tag 'name' longer than 255 chars you could consider forking, adding a migration from 'string' to 'text' and erase or extend the validation maximum size.

seuros commented 9 years ago

@constantm, make it configurable with 255 as default and send a PR.

constantm commented 9 years ago

Okay I'm not missing anything then. I'll see what I can do.

klacointe commented 8 years ago

+1 for a PR with this feature.