This project is archived and is in readonly mode.

#384 ✓resolved
Paul Sadauskas (Rando)

connection#insert no longer returns last inserted id

Reported by Paul Sadauskas (Rando) | June 10th, 2008 @ 10:33 PM | in 2.1.1

In rails 2.0, I have several postgres migrations that rely on @connection.insert returning the last inserted id. When I upgraded to the 2.1 gems, this stopped working, and #insert now returns nil. The docs still say that #insert should return the last inserted id.

Attached is a patch that adds a failing unit test for this behavior. Note: I couldn't find ANY tests for any of the DatabaseStatements methods. I created a new file, test/cases/database_statements_test.rb.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages