aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/relations/writes
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/relations/writes')
-rw-r--r--lib/arel/relations/writes/insert.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/arel/relations/writes/insert.rb b/lib/arel/relations/writes/insert.rb
index 0545d7faa3..d579ad06d0 100644
--- a/lib/arel/relations/writes/insert.rb
+++ b/lib/arel/relations/writes/insert.rb
@@ -11,13 +11,13 @@ module Arel
[
"INSERT",
"INTO #{table_sql}",
- "(#{record.keys.collect(&:to_sql).join(', ')})",
- "VALUES (#{record.collect { |key, value| key.format(value) }.join(', ')})"
+ "(#{record.keys.map { |key| engine.quote_column_name(key.name) }.join(', ')})",
+ "VALUES (#{record.map { |key, value| key.format(value) }.join(', ')})"
].join("\n")
end
-
- def call(connection = engine.connection)
+
+ def call(connection = engine)
connection.insert(to_sql)
end
end
-end \ No newline at end of file
+end