提交 302b6f3f 编写于 作者: A Aaron Patterson

pg does not know the insert_id in advance, so super will never return true

上级 4c30304e
......@@ -441,10 +441,8 @@ def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
return id
end
# Otherwise, insert then grab last_insert_id.
if insert_id = super
insert_id
else
super
# If neither pk nor sequence name is given, look them up.
unless pk || sequence_name
pk, sequence_name = *pk_and_sequence_for(table)
......@@ -456,7 +454,6 @@ def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
last_insert_id(sequence_name)
end
end
end
alias :create :insert
# create a 2D array representing the result set
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册