diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-07-30 00:08:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 00:08:27 +0900 |
commit | 2e6d9af6c8b9900481dabfca685b3e335c2f27aa (patch) | |
tree | e2af35d2fb64037fe3764bb9b9a026f1fa91f053 /activerecord/lib/arel | |
parent | 79740de065e9b5ff03e9956f7e6151f6e1c03f58 (diff) | |
parent | 92c265b3ad89303e53e64f7ead4499066966c722 (diff) | |
download | rails-2e6d9af6c8b9900481dabfca685b3e335c2f27aa.tar.gz rails-2e6d9af6c8b9900481dabfca685b3e335c2f27aa.tar.bz2 rails-2e6d9af6c8b9900481dabfca685b3e335c2f27aa.zip |
Merge pull request #36800 from jamespearson/matches_regex_mysql
Enabled matches_regex for MySql
Diffstat (limited to 'activerecord/lib/arel')
-rw-r--r-- | activerecord/lib/arel/visitors/mysql.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/arel/visitors/mysql.rb b/activerecord/lib/arel/visitors/mysql.rb index dd77cfdf66..6cb866715f 100644 --- a/activerecord/lib/arel/visitors/mysql.rb +++ b/activerecord/lib/arel/visitors/mysql.rb @@ -48,6 +48,14 @@ module Arel # :nodoc: all visit_Arel_Nodes_IsNotDistinctFrom o, collector end + def visit_Arel_Nodes_Regexp(o, collector) + infix_value o, collector, " REGEXP " + end + + def visit_Arel_Nodes_NotRegexp(o, collector) + infix_value o, collector, " NOT REGEXP " + end + # In the simple case, MySQL allows us to place JOINs directly into the UPDATE # query. However, this does not allow for LIMIT, OFFSET and ORDER. To support # these, we must use a subquery. |