diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-13 08:09:37 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-13 08:09:37 +0000 |
commit | a762939894ec2f825ccafd439ce17bb30fc65dc3 (patch) | |
tree | b093721da17584799f1c87a1dde432a8a57f76be | |
parent | 068d9ef0effb8bfbcaf23f990335c0c867e5a1d7 (diff) | |
download | rails-a762939894ec2f825ccafd439ce17bb30fc65dc3.tar.gz rails-a762939894ec2f825ccafd439ce17bb30fc65dc3.tar.bz2 rails-a762939894ec2f825ccafd439ce17bb30fc65dc3.zip |
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
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 82295f1f49..9c5b4c9c79 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -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) |