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.95k stars 1.18k forks source link

Support for labels through additional columns in tags table? #1096

Open palladius opened 1 year ago

palladius commented 1 year ago

Hi, fist I'm a huge fan , used my first acts-as-taggable 10 years ago, and happy to see this gem flourishing.

I was looking at a labelling mechanism for rails, the ability to inject labels like [:env, 'prod'] and [:env, 'dev'] into multiple models.

I was wondering (since there's no acts-as-labellable gem) if I can simply achieve this by using the acts-as-taggable an tweaking it a bit (eg, add a column label_value) to the tags column. I don't want to get it too dirty, so I would love some guidance to understand if this is doable already or if this would require some major rewriting. For instance, the primary key would have to switch from single to double column, and maybe I would have to touch the code in too many places to make it not worthwhile.

I seek your guidance in understanding how it can be done, and I volunteer to file a PR on documentation after I get this working.

Thanks in advance.