From acdb9ea3036466b6553c85486f8fdfc5909f1275 Mon Sep 17 00:00:00 2001 From: Ernie Miller Date: Thu, 15 Apr 2010 19:40:30 -0400 Subject: Alternate syntax for Predicate#and and Predicate#or, using & and | --- lib/arel/algebra/predicates.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/arel/algebra/predicates.rb b/lib/arel/algebra/predicates.rb index 2da37af2e7..5e17cdd101 100644 --- a/lib/arel/algebra/predicates.rb +++ b/lib/arel/algebra/predicates.rb @@ -4,11 +4,19 @@ module Arel def or(other_predicate) Or.new(self, other_predicate) end + + def |(other_predicate) + Or.new(self, other_predicate) + end def and(other_predicate) And.new(self, other_predicate) end + def &(other_predicate) + And.new(self, other_predicate) + end + def complement Not.new(self) end -- cgit v1.2.3