对于Sqilte3 C API,我将使用sqlite3_last_insert_rowid
。插入新记录后如何在使用ActiveRecord时获取此ID?我用下面的方法来插入新记录:使用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