activerecord-hackery / ransack

Object-based searching.
https://activerecord-hackery.github.io/ransack/
MIT License
5.61k stars 782 forks source link

`_cont` filter adding extra quotes #1461

Open lloydwatkin opened 7 months ago

lloydwatkin commented 7 months ago
irb(main):002:0> Inbound.ransack(payload_cont: 'test').result
  [replica/1] Inbound Load (9.5ms)  SELECT `inbounds`.* FROM `inbounds` WHERE `webhook_inbounds`.`payload` LIKE '\"%test%\"'
=> []                                                                       
irb(main):003:0> Inbound.ransack(payload_contains: 'test').result
  [replica/1] Inbound Load (40.3ms)  SELECT `inbounds`.* FROM `inbounds`

We're not doing anything special with our Ransack setup.

Ransack @ 4.1.1 Rails @ 7.0.8

We're using MySQL.

Connects to https://github.com/activeadmin/activeadmin/issues/8136

lloydwatkin commented 7 months ago

I thought maybe it was because we were using Makara to handle our MySQL connection, I've taken this out and that's not the case. I'll try and upgrade Rails in this repo and see if that makes a difference.