diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/relations/join.rb | 8 | ||||
-rw-r--r-- | lib/arel/relations/relation.rb | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/arel/relations/join.rb b/lib/arel/relations/join.rb index 048cb170e5..0dec80af79 100644 --- a/lib/arel/relations/join.rb +++ b/lib/arel/relations/join.rb @@ -57,11 +57,11 @@ module Arel def relation_for(attribute) x = [relation1[attribute], relation2[attribute]].select { |a| a =~ attribute }.min do |a1, a2| (attribute % a1).size <=> (attribute % a2).size - end - if x.relation.aggregation? - x.relation + end.relation + if x.aggregation? + x else - x.original_relation + x.relation_for(attribute) end end diff --git a/lib/arel/relations/relation.rb b/lib/arel/relations/relation.rb index 846594e7cd..336960f424 100644 --- a/lib/arel/relations/relation.rb +++ b/lib/arel/relations/relation.rb @@ -103,10 +103,6 @@ module Arel def name_for(relation) relation.name end - - def table - self - end end include Externalizable |