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:
parent
6f2230652d
commit
703326cdc2
2 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ module Arel
|
|||
def initialize
|
||||
@relation = nil
|
||||
@wheres = []
|
||||
@values = nil
|
||||
@values = []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue