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

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 Compare July 29, 2019 11:35
Copy link
Member

@kamipo kamipo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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
Copy link
Contributor Author

@kamipo - Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants