aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/relations/relation.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-05 11:22:48 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-05 11:22:48 -0700
commitb9e90e4e55290172d7c5918319fd5fe35aa6a10e (patch)
treeef63a7974dd97012fc72dc3d33ec25f0884620e7 /lib/arel/relations/relation.rb
parentcd428ee66498146d3dc14f58c6534d79ab124b45 (diff)
downloadrails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.tar.gz
rails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.tar.bz2
rails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.zip
better column disambiguation
Diffstat (limited to 'lib/arel/relations/relation.rb')
-rw-r--r--lib/arel/relations/relation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/relations/relation.rb b/lib/arel/relations/relation.rb
index cc0f40ea17..8c56a0cdcc 100644
--- a/lib/arel/relations/relation.rb
+++ b/lib/arel/relations/relation.rb
@@ -140,8 +140,8 @@ module Arel
end
def attribute_for_attribute(attribute)
- attributes.select { |a| a =~ attribute }.min do |a1, a2|
- (attribute % a1).size <=> (attribute % a2).size
+ attributes.select { |a| a =~ attribute }.max do |a1, a2|
+ (attribute / a1) <=> (attribute / a2)
end
end
end