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

tagged_with and ESCAPE #1035

Closed francesco-loreti closed 3 years ago

francesco-loreti commented 3 years ago

I have a problem with tagged_with function. When I add % for like search, the results is blank. For example: Model.tagged_with("%test%", any: true) is trasformed into WHERE ("tags"."name" LIKE '!%test!%' ESCAPE '!') and the query not found anything :( If I remove ! from the query and execute it, I found all rows. Can I remove the escape character?

Thanks!!!

francesco-loreti commented 3 years ago

I have solved it by replacing any: true with wild: true.