mirror of
https://github.com/github/rails.git
synced 2026-01-27 15:28:00 -05:00
PostgreSQL: last_insert_id uses select_value rather than using @connection.exec directly.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -305,12 +305,12 @@ module ActiveRecord
|
||||
execute "DROP INDEX #{index_name}"
|
||||
end
|
||||
|
||||
|
||||
|
||||
private
|
||||
BYTEA_COLUMN_TYPE_OID = 17
|
||||
|
||||
def last_insert_id(table, sequence_name)
|
||||
Integer(@connection.exec("SELECT currval('#{sequence_name}')")[0][0])
|
||||
Integer(select_value("SELECT currval('#{sequence_name}')"))
|
||||
end
|
||||
|
||||
def select(sql, name = nil)
|
||||
|
||||
Reference in New Issue
Block a user