diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-18 16:47:55 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-18 16:47:55 -0700 |
commit | 7feff4e7b52fbef356426d22257af161704315ad (patch) | |
tree | db907c2bc27dc406d08513d40f8e75cd810a91f9 /lib/arel/predicates.rb | |
parent | 32ad530b825f4cdac51e579306548ca695471039 (diff) | |
download | rails-7feff4e7b52fbef356426d22257af161704315ad.tar.gz rails-7feff4e7b52fbef356426d22257af161704315ad.tar.bz2 rails-7feff4e7b52fbef356426d22257af161704315ad.zip |
performance enhancements
Diffstat (limited to 'lib/arel/predicates.rb')
-rw-r--r-- | lib/arel/predicates.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/arel/predicates.rb b/lib/arel/predicates.rb index b375f37ff4..f21376d4c9 100644 --- a/lib/arel/predicates.rb +++ b/lib/arel/predicates.rb @@ -1,8 +1,5 @@ module Arel class Predicate - def ==(other) - self.class == other.class - end end class Binary < Predicate @@ -13,7 +10,9 @@ module Arel end def ==(other) - super and @operand1 == other.operand1 and @operand2 == other.operand2 + self.class === other and + @operand1 == other.operand1 and + @operand2 == other.operand2 end def bind(relation) @@ -28,7 +27,7 @@ module Arel class Equality < Binary def ==(other) - Equality == other.class and + Equality === other and ((operand1 == other.operand1 and operand2 == other.operand2) or (operand1 == other.operand2 and operand2 == other.operand1)) end |