activerecord-like icon indicating copy to clipboard operation
activerecord-like copied to clipboard

Specify if search should be case-insensitivity

Open EdCordata opened this issue 3 years ago • 1 comments

I think it should be a good feature to add case-insensitivity.

So that would be this in MySql:

LOWER(posts.title) LIKE (?)

or this in PostgeSQL:

posts.title ILIKE (?)

So, maybe it could be:

Post.where.ilike(title: "%rails%")
Post.where.not_ilike(title: "%rails%")

EdCordata avatar Apr 13 '21 12:04 EdCordata

Hi EdCordata,

Sorry for not getting back to you sooner, I haven't been around Github recently.

According to the tests, the search is already case insensitive. Are you seeing any bugs there?

If you want any additional behavior - like case sensitivity, rather than insensitivity - I would happily accept any pull requests (with passing tests), but I haven't been doing any active Rails development for years so I think it would be quite a tough nut for me to crack.

ReneB avatar Jul 06 '21 23:07 ReneB