未验证 提交 e3e78219 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #32667 from yahonda/mod_empty_insert_statement_value

Allow `primary_key` argument to  `empty_insert_statement_value`
......@@ -385,7 +385,7 @@ def insert_fixtures_set(fixture_set, tables_to_delete = [])
end
end
def empty_insert_statement_value
def empty_insert_statement_value(primary_key = nil)
"DEFAULT VALUES"
end
......
......@@ -223,7 +223,7 @@ def join_to_update(update, select, key) # :nodoc:
end
end
def empty_insert_statement_value
def empty_insert_statement_value(primary_key = nil)
"VALUES ()"
end
......
......@@ -178,7 +178,7 @@ def _insert_record(values) # :nodoc:
end
if values.empty?
im = arel_table.compile_insert(connection.empty_insert_statement_value)
im = arel_table.compile_insert(connection.empty_insert_statement_value(primary_key))
im.into arel_table
else
im = arel_table.compile_insert(_substitute_values(values))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册