From 7feff4e7b52fbef356426d22257af161704315ad Mon Sep 17 00:00:00 2001 From: Nick Kallen <nkallen@nick-kallens-computer-2.local> Date: Sun, 18 May 2008 16:47:55 -0700 Subject: performance enhancements --- lib/arel/primitives/attribute.rb | 10 +++++----- lib/arel/primitives/expression.rb | 10 +++++----- lib/arel/primitives/value.rb | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/arel/primitives') diff --git a/lib/arel/primitives/attribute.rb b/lib/arel/primitives/attribute.rb index 011b751a1d..ca1d31ffcf 100644 --- a/lib/arel/primitives/attribute.rb +++ b/lib/arel/primitives/attribute.rb @@ -30,11 +30,11 @@ module Arel end def ==(other) - Attribute == other.class and - name == other.name and - @alias == other.alias and - ancestor == other.ancestor and - relation == other.relation + Attribute === other and + name == other.name and + @alias == other.alias and + ancestor == other.ancestor and + relation == other.relation end def original_relation diff --git a/lib/arel/primitives/expression.rb b/lib/arel/primitives/expression.rb index 696e3521be..9afafcce2f 100644 --- a/lib/arel/primitives/expression.rb +++ b/lib/arel/primitives/expression.rb @@ -17,11 +17,11 @@ module Arel end def ==(other) - Expression == other.class and - attribute == other.attribute and - function_sql == other.function_sql and - ancestor == other.ancestor and - @alias == other.alias + Expression === other and + attribute == other.attribute and + function_sql == other.function_sql and + ancestor == other.ancestor and + @alias == other.alias end module Transformations diff --git a/lib/arel/primitives/value.rb b/lib/arel/primitives/value.rb index b4bddd0b0c..4509f13d17 100644 --- a/lib/arel/primitives/value.rb +++ b/lib/arel/primitives/value.rb @@ -17,8 +17,8 @@ module Arel end def ==(other) - Value == other.class and - value == other.value + Value === other and + value == other.value end def bind(relation) -- cgit v1.2.3