From 116b6f05b0e72ce35808cb42dfbe4c543d8504ea Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Wed, 7 May 2008 00:32:32 -0700 Subject: removing operator overloading --- lib/arel/primitives/attribute.rb | 2 +- lib/arel/relations/relation.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/arel/primitives/attribute.rb b/lib/arel/primitives/attribute.rb index 30c03839e2..78a519b35c 100644 --- a/lib/arel/primitives/attribute.rb +++ b/lib/arel/primitives/attribute.rb @@ -65,7 +65,7 @@ module Arel [self] + (ancestor ? [ancestor, ancestor.history].flatten : []) end - def =~(other) + def match?(other) !(history & other.history).empty? end diff --git a/lib/arel/relations/relation.rb b/lib/arel/relations/relation.rb index fc47a129a0..250eb85222 100644 --- a/lib/arel/relations/relation.rb +++ b/lib/arel/relations/relation.rb @@ -141,7 +141,7 @@ module Arel # TESTME - added relation_for(x)[x] because of AR def attribute_for_attribute(attribute) - attributes.select { |a| a =~ attribute }.max do |a1, a2| + attributes.select { |a| a.match?(attribute) }.max do |a1, a2| (attribute / relation_for(a1)[a1]) <=> (attribute / relation_for(a2)[a2]) end end -- cgit v1.2.3