From 33a9cdc9963489759b75102dd0df48b5a1987369 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 20 Jul 2010 16:33:23 -0700 Subject: inequality is a special case of equality --- lib/arel/algebra/predicates.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/predicates.rb b/lib/arel/algebra/predicates.rb index e98e152dbd..1b9667ac13 100644 --- a/lib/arel/algebra/predicates.rb +++ b/lib/arel/algebra/predicates.rb @@ -109,7 +109,7 @@ module Arel class Equality < Binary def ==(other) - Equality === other and + self.class === other and ((operand1 == other.operand1 and operand2 == other.operand2) or (operand1 == other.operand2 and operand2 == other.operand1)) end @@ -119,13 +119,7 @@ module Arel end end - class Inequality < Binary - def ==(other) - Equality === other and - ((operand1 == other.operand1 and operand2 == other.operand2) or - (operand1 == other.operand2 and operand2 == other.operand1)) - end - + class Inequality < Equality def complement Equality.new(operand1, operand2) end -- cgit v1.2.3