activerecord-like
activerecord-like copied to clipboard
Specify if search should be case-insensitivity
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%")
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.