I have a tagging system using awesom开发者_Python百科e_nested_set, which works great and lays out a nice hierarchy in the tags such that "Customer Relationship Management" is under "Enterprise Resource Planning."
I'd like to include synonyms such that if someone adds the tag "CRM," I can recognize that "CRM" just means "Customer Relationship Management" and actually display the tag "Customer Relationship Management."
I would of thought that I can somehow mark a tag "CRM" as a synonym and any references to this tag will be redirected in "Customer Relationship Management"
Is it possible to do this with awesome_nested_set? Or is there another gem or method?
My only current thought is that I could make a flag for each item and then build a whole bunch of logic such that when I try to fetch a tag which is marked synonym, it instead returns the parent. Then I just have to mark "CRM" as a child of "Customer Relationship Management" and set as a synonym. But that seems incredibly inelegant.
Thanks!
精彩评论