diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-06-10 19:53:51 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-06-10 19:53:51 -0300 |
commit | 3e6ad6e5838d20c946d7a286cb34be12aae177ff (patch) | |
tree | 6a8c7d475b98d367338a813294e0df68116b51ab | |
parent | 324f265c1de98212f59f42c287d441b85b2350b7 (diff) | |
download | rails-3e6ad6e5838d20c946d7a286cb34be12aae177ff.tar.gz rails-3e6ad6e5838d20c946d7a286cb34be12aae177ff.tar.bz2 rails-3e6ad6e5838d20c946d7a286cb34be12aae177ff.zip |
Allow strings as update assignments
-rw-r--r-- | lib/arel/engines/sql/relations/writes.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/arel/engines/sql/relations/writes.rb b/lib/arel/engines/sql/relations/writes.rb index f1a9bfd2ac..f7073654e9 100644 --- a/lib/arel/engines/sql/relations/writes.rb +++ b/lib/arel/engines/sql/relations/writes.rb @@ -31,9 +31,13 @@ module Arel protected def assignment_sql - assignments.collect do |attribute, value| - "#{engine.quote_column_name(attribute.name)} = #{attribute.format(value)}" - end.join(",\n") + if assignments.respond_to?(:collect) + assignments.collect do |attribute, value| + "#{engine.quote_column_name(attribute.name)} = #{attribute.format(value)}" + end.join(",\n") + else + assignments.value + end end end end |