aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-15 19:44:06 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-15 19:44:06 -0700
commite4ee2a35c8dc62efed965bf0023a517c65f1c9e7 (patch)
treef32170a1e0e6b86600cc981844e632efbb38beed
parentfdffe2160a4b855d7d9e611c6326f4a509c7cb07 (diff)
downloadrails-e4ee2a35c8dc62efed965bf0023a517c65f1c9e7.tar.gz
rails-e4ee2a35c8dc62efed965bf0023a517c65f1c9e7.tar.bz2
rails-e4ee2a35c8dc62efed965bf0023a517c65f1c9e7.zip
worser
-rw-r--r--lib/arel/relations/grouping.rb2
-rw-r--r--spec/arel/unit/relations/join_spec.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/relations/grouping.rb b/lib/arel/relations/grouping.rb
index 3f0ea54407..2c39d23b2d 100644
--- a/lib/arel/relations/grouping.rb
+++ b/lib/arel/relations/grouping.rb
@@ -17,7 +17,7 @@ module Arel
end
def name
- table.name + '_aggregation'
+ relation.name + '_aggregation'
end
end
end \ No newline at end of file
diff --git a/spec/arel/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb
index 46215b158b..b3cd28ac25 100644
--- a/spec/arel/unit/relations/join_spec.rb
+++ b/spec/arel/unit/relations/join_spec.rb
@@ -69,6 +69,10 @@ module Arel
it '' do
p @relation1.select(@relation1[:id].eq(1)).join(@relation2).on(@predicate).select(@relation1[:id].eq(1)).to_sql
end
+
+ it '' do
+ p @relation1.join(@relation2).on(@predicate).group(@relation1[:id]).to_sql
+ end
end
end