How to use senitize_sql_like together with ilike

Asked

Viewed 46 times

1

I’m having trouble using the senitize_sql_like, along with the ilike.

When I use it, the query is not returning the expected value, it follows the implementation used:

scope :brand_name_by_content, -> (brand, sna)
{sna.top_contents.where(sanitize_sql_like("content ilike '%#
{Brand.find(brand[0]).name}%'"))}
  • manages to include what it is returning, what you expected it to return and the structure of your db? enjoy and tour!

  • to include more data, change your question by clicking on edit.

  • I was wrong about the Sanitize call.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.