This project is archived and is in readonly mode.
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
-
Jeremy Kemper June 10th, 2008 @ 10:41 PM
- Milestone set to 2.1.1
- State changed from new to open
- Assigned user set to Jeremy Kemper
-
Repository June 10th, 2008 @ 11:54 PM
- State changed from open to resolved
(from [a065144afb9e8b4666a5097e3e81de80251e86e6]) PostgreSQL: insert looks up pk and sequence name if not given. [#384 state:resolved]
-
Repository June 10th, 2008 @ 11:54 PM
(from [b440aeb54a969ec25228881dd02eb019bbfd7c1e]) PostgreSQL: insert looks up pk and sequence name if not given. [#384 state:resolved]
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>