Skip to content

Commit

Permalink
Alternate syntax for Predicate#and and Predicate#or, using & and |
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernie Miller committed May 7, 2010
1 parent bd47334 commit acdb9ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/arel/algebra/predicates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ class Predicate
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
Expand Down

0 comments on commit acdb9ea

Please sign in to comment.