aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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