diff options
author | Ernie Miller <ernie@metautonomo.us> | 2010-04-15 19:40:30 -0400 |
---|---|---|
committer | Ernie Miller <ernie@metautonomo.us> | 2010-05-07 13:08:31 -0400 |
commit | acdb9ea3036466b6553c85486f8fdfc5909f1275 (patch) | |
tree | 2033c624833bc19089f8d30f1db528cdebf7fcf8 /lib/arel/algebra | |
parent | bd473344000bd538d353e4bc6d20ca8fff2e4704 (diff) | |
download | rails-acdb9ea3036466b6553c85486f8fdfc5909f1275.tar.gz rails-acdb9ea3036466b6553c85486f8fdfc5909f1275.tar.bz2 rails-acdb9ea3036466b6553c85486f8fdfc5909f1275.zip |
Alternate syntax for Predicate#and and Predicate#or, using & and |
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r-- | lib/arel/algebra/predicates.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |