1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

defaulting values to a list

This commit is contained in:
Aaron Patterson 2010-08-14 19:14:49 -07:00
parent 6f2230652d
commit 703326cdc2
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ module Arel
def initialize
@relation = nil
@wheres = []
@values = nil
@values = []
end
end
end

View file

@ -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