From 703326cdc2e6ad426c09cfbf7983f893552ac845 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 14 Aug 2010 19:14:49 -0700 Subject: defaulting values to a list --- lib/arel/visitors/to_sql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/arel/visitors/to_sql.rb') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 9a9dd20d52..4c2a6a10e4 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -17,7 +17,7 @@ module Arel "UPDATE #{visit o.relation}", ("SET #{o.values.map { |column,value| "#{quote_column_name(column.name)} = #{quote visit value}" - }.join ', '}" if o.values), + }.join ', '}" unless o.values.empty?), ("WHERE #{o.wheres.map { |x| visit x }.join ' AND '}" unless o.wheres.empty?) ].compact.join ' ' end -- cgit v1.2.3