Permalink
Browse files

r3037@asus: jeremy | 2005-11-13 00:11:26 -0800

 Apply [2998] to stable.  PostgreSQL: last_insert_id uses select_value rather than using @connection.exec directly.


git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@2999 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
jeremy committed Nov 13, 2005
1 parent 532d4e8 commit f0b5630dce0fe5de8a95ebcf1094b39154ad4555
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -305,12 +305,12 @@ def remove_index(table_name, options) #:nodoc:
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)

0 comments on commit f0b5630

Please sign in to comment.