【发布时间】:2011-02-25 00:22:32
【问题描述】:
对于 Sqilte3 C API,我会使用 sqlite3_last_insert_rowid。插入新记录后使用 ActiveRecord 时如何获取此 ID?我使用以下方式插入新记录:
Section.new |s|
s.a = 1
s.b = 2
#I expected the return value of save to be the last_insert_id, but it is NOT
s.save
end
【问题讨论】:
标签: ruby sqlite activerecord