aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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