aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/arel/table.rb4
-rw-r--r--spec/arel/table_spec.rb9
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb
index 434f19cc6b..28243e645e 100644
--- a/lib/arel/table.rb
+++ b/lib/arel/table.rb
@@ -41,6 +41,10 @@ module Arel
end
end
+ def group *columns
+ tm.group(*columns)
+ end
+
def order *expr
tm.order(*expr)
end
diff --git a/spec/arel/table_spec.rb b/spec/arel/table_spec.rb
index 8e27d60078..223453f708 100644
--- a/spec/arel/table_spec.rb
+++ b/spec/arel/table_spec.rb
@@ -28,6 +28,15 @@ module Arel
end
end
+ describe 'group' do
+ it 'should create a group' do
+ manager = @relation.group @relation[:id]
+ manager.to_sql.should be_like %{
+ SELECT FROM "users" GROUP BY "users"."id"
+ }
+ end
+ end
+
describe 'alias' do
it 'should create a node that proxies to a table' do
check @relation.aliases.should == []