how to pass the string without double quotes in rails string interpolation?

547 views Asked by At

I am framing the query value like 'keys.description LIKE ?','desc%' to pass inside where condition in active record query.

The problem is when I store this value in string

query = "'keys.description LIKE?','desc%'"

When I interpolate it in query Class.select.where("#{query}") the equivalent sql condition is coming like this where('keys.description LIKE ?','desc%') instead of where(keys.description LIKE ? desc%).

0

There are 0 answers