diff options
-rw-r--r-- | lib/arel/table.rb | 4 | ||||
-rw-r--r-- | spec/arel/table_spec.rb | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index 28243e645e..0e8b3782bb 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -53,8 +53,8 @@ module Arel tm.where condition end - def project thing - tm.project thing + def project *things + tm.project *things end def take amount diff --git a/spec/arel/table_spec.rb b/spec/arel/table_spec.rb index 223453f708..e67c371577 100644 --- a/spec/arel/table_spec.rb +++ b/spec/arel/table_spec.rb @@ -79,10 +79,12 @@ module Arel describe 'project' do it 'can project' do manager = @relation.project SqlLiteral.new '*' - manager.to_sql.should be_like %{ - SELECT * - FROM "users" - } + manager.to_sql.should be_like %{ SELECT * FROM "users" } + end + + it 'takes multiple parameters' do + manager = @relation.project SqlLiteral.new('*'), SqlLiteral.new('*') + manager.to_sql.should be_like %{ SELECT *, * FROM "users" } end end |