提交 15633519 编写于 作者: A Aaron Patterson

removing some calls to insert on arel

上级 acbabd96
......@@ -49,7 +49,7 @@ def insert_record(record, force = true, validate = true)
timestamps = record_timestamp_columns(record)
timezone = record.send(:current_time_from_proper_timezone) if timestamps.any?
attributes = Hash[columns.map do |column|
attributes = columns.map do |column|
name = column.name
value = case name.to_s
when @reflection.primary_key_name.to_s
......@@ -62,9 +62,10 @@ def insert_record(record, force = true, validate = true)
@owner.send(:quote_value, record[name], column) if record.has_attribute?(name)
end
[relation[name], value] unless value.nil?
end]
end
relation.insert(attributes)
stmt = relation.compile_insert Hash[attributes]
@owner.connection.insert stmt.to_sql
end
true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册