aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/predications.rb
diff options
context:
space:
mode:
authorKeenan Brock <keenan@thebrocks.net>2015-12-05 20:23:12 -0500
committerKeenan Brock <keenan@thebrocks.net>2015-12-05 20:23:12 -0500
commitd2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf (patch)
tree8715cc5153868d329596827edf97dc1443122e6b /lib/arel/predications.rb
parent4e7b4693b89d920e43f5c2c94b44957a3f392a80 (diff)
downloadrails-d2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf.tar.gz
rails-d2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf.tar.bz2
rails-d2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf.zip
introduce predicate {does_not_}matches_regexp
Diffstat (limited to 'lib/arel/predications.rb')
-rw-r--r--lib/arel/predications.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/predications.rb b/lib/arel/predications.rb
index ed083f5402..1d2b0de235 100644
--- a/lib/arel/predications.rb
+++ b/lib/arel/predications.rb
@@ -122,6 +122,10 @@ Passing a range to `#not_in` is deprecated. Call `#not_between`, instead.
Nodes::Matches.new self, quoted_node(other), escape, case_sensitive
end
+ def matches_regexp other, case_sensitive = true
+ Nodes::Regexp.new self, quoted_node(other), case_sensitive
+ end
+
def matches_any others, escape = nil, case_sensitive = false
grouping_any :matches, others, escape, case_sensitive
end
@@ -134,6 +138,10 @@ Passing a range to `#not_in` is deprecated. Call `#not_between`, instead.
Nodes::DoesNotMatch.new self, quoted_node(other), escape, case_sensitive
end
+ def does_not_match_regexp other, case_sensitive = true
+ Nodes::NotRegexp.new self, quoted_node(other), case_sensitive
+ end
+
def does_not_match_any others, escape = nil
grouping_any :does_not_match, others, escape
end