-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case insensitivite match/regular expressions #403
Conversation
Explicitly declare if this is case sensitive or not most implementation assume case sensitive postgres assumes case insensitive
Explicitly declare if this is case sensitive or not currently postgres assumes case insensitive regexp no other databases support regexps
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @tenderlove (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@tenderlove I can change this to have a different Arel operator for case insensitive operators instead of booleans. Just let me know. |
Wonder if this is a little related to #286 I can split this PR into 2. Just ask that you state a preference around whether a) to default to case insensitive or sensitive and b) is case sensitive a boolean or a separate token? Thanks |
@kbrock tbh I'm totally fine with this. I'll merge it. |
Case insensitivite match/regular expressions
Hello all,
Postgres supports case sensitive and insensitive operations.
Regular expressions match (
~
) currently defaults to case sensitive but match (LIKE
) defaults to case insensitive.The goal of this PR is to
matches_regexp
anddoes_not_match_regexp
.I'd like it if both regular expressions and like match defaulted to case sensitivity, but that would change the def sql generated by postgres and I assume that is discouraged.
If you would like me to make both operators default to case sensitive (or case insensitive), let me know.
/cc @matthewd @tenderlove thoughts?