diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-07 00:32:32 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-07 00:32:32 -0700 |
commit | 116b6f05b0e72ce35808cb42dfbe4c543d8504ea (patch) | |
tree | a48530734159cf67148f78faa4cfd3b29a42dbdd /lib/arel | |
parent | f22ea4dd5b20c979dbacf8fd5768659e9e4d0706 (diff) | |
download | rails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.tar.gz rails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.tar.bz2 rails-116b6f05b0e72ce35808cb42dfbe4c543d8504ea.zip |
removing operator overloading
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/primitives/attribute.rb | 2 | ||||
-rw-r--r-- | lib/arel/relations/relation.rb | 2 |
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 |