Skip to content

Commit

Permalink
Removal of operator overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernie Miller committed May 7, 2010
1 parent 6249e58 commit b11b750
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions lib/arel/algebra/predicates.rb
Expand Up @@ -4,35 +4,17 @@ 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

def not
complement
end

if respond_to?('!') # Nice! We're running Ruby 1.9 and can override the inherited BasicObject#!
def empty? # Need to define empty? to keep Object#blank? from going haywire
false
end

define_method('!') do
self.complement
end
self.complement
end
end

Expand Down

0 comments on commit b11b750

Please sign in to comment.