diff options
author | Matthew Draper <matthew@trebex.net> | 2014-09-26 08:21:01 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-09-26 08:21:01 +0930 |
commit | cdae8216f582e035370b84edd236af7d22702e75 (patch) | |
tree | 6f607b2c312db046a488629f39bd8755b4cbc5c9 /lib/arel/nodes | |
parent | b57a11cb8abfca345f63084ce841c6f412c1156e (diff) | |
parent | fef9ce493ec3eab3cf120550abd0257f89eaddf7 (diff) | |
download | rails-cdae8216f582e035370b84edd236af7d22702e75.tar.gz rails-cdae8216f582e035370b84edd236af7d22702e75.tar.bz2 rails-cdae8216f582e035370b84edd236af7d22702e75.zip |
Merge pull request #318 from tamird/match-escape
{Matches,DoesNotMatch} support the ESCAPE clause
Diffstat (limited to 'lib/arel/nodes')
-rw-r--r-- | lib/arel/nodes/binary.rb | 2 | ||||
-rw-r--r-- | lib/arel/nodes/matches.rb | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/arel/nodes/binary.rb b/lib/arel/nodes/binary.rb index 939684957f..e35d2fd2e7 100644 --- a/lib/arel/nodes/binary.rb +++ b/lib/arel/nodes/binary.rb @@ -31,13 +31,11 @@ module Arel As Assignment Between - DoesNotMatch GreaterThan GreaterThanOrEqual Join LessThan LessThanOrEqual - Matches NotEqual NotIn NotRegexp diff --git a/lib/arel/nodes/matches.rb b/lib/arel/nodes/matches.rb new file mode 100644 index 0000000000..583fb97c9b --- /dev/null +++ b/lib/arel/nodes/matches.rb @@ -0,0 +1,14 @@ +module Arel + module Nodes + class Matches < Binary + attr_reader :escape + + def initialize(left, right, escape = nil) + super(left, right) + @escape = escape && Nodes.build_quoted(escape) + end + end + + class DoesNotMatch < Matches; end + end +end |