aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-07 00:32:32 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-07 00:32:32 -0700
commit116b6f05b0e72ce35808cb42dfbe4c543d8504ea (patch)
treea48530734159cf67148f78faa4cfd3b29a42dbdd /lib
parentf22ea4dd5b20c979dbacf8fd5768659e9e4d0706 (diff)
downloadrails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.tar.gz
rails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.tar.bz2
rails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.zip
removing operator overloading
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/primitives/attribute.rb2
-rw-r--r--lib/arel/relations/relation.rb2
2 files changed, 2 insertions, 2 deletions
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