Skip to content
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

Enabled matches_regex for MySql #36800

Merged
merged 1 commit into from Jul 29, 2019
Merged

Conversation

@jamespearson
Copy link
Contributor

@jamespearson jamespearson commented Jul 29, 2019

Previously matches_regex was only available on PostgreSQL, this will enable it for MySql

Usage example:

    users = User.arel_table;

    # Find all gmail users
    users = User.arel_table; User.where(users[:email].matches_regexp('(.*)\@gmail.com'))

    # Find all none gmail users
    users = User.arel_table; User.where(users[:email].does_not_match_regexp('(.*)\@gmail.com'))
@jamespearson jamespearson force-pushed the matches_regex_mysql branch 3 times, most recently from 3a62a4d to 4ebb9fe Jul 29, 2019
kamipo
kamipo approved these changes Jul 29, 2019
Copy link
Member

@kamipo kamipo left a comment

Looks good to me. Can you squash commits into one?

Loading

Previously matches_regex was only availble on PostgreSql, this will enable it for MySql

Usage example:

    users = User.arel_table;
    users = User.arel_table; User.where(users[:email].matches_regexp('(.*)\@gmail.com'))

Update activerecord/test/cases/arel/visitors/mysql_test.rb

Co-Authored-By: Ryuta Kamizono <kamipo@gmail.com>
@jamespearson jamespearson force-pushed the matches_regex_mysql branch from fda8cf6 to 92c265b Jul 29, 2019
@jamespearson
Copy link
Contributor Author

@jamespearson jamespearson commented Jul 29, 2019

@kamipo - Done

Loading

@kamipo kamipo merged commit 2e6d9af into rails:master Jul 29, 2019
2 checks passed
Loading
kamipo added a commit that referenced this issue Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants