Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2998

Show
Ignore:
Timestamp:
11/13/05 08:09:37 (3 years ago)
Author:
bitsweat
Message:

PostgreSQL: last_insert_id uses select_value rather than using @connection.exec directly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

    r2994 r2998  
    306306      end       
    307307 
    308        
     308 
    309309      private 
    310310        BYTEA_COLUMN_TYPE_OID = 17 
    311311 
    312312        def last_insert_id(table, sequence_name) 
    313           Integer(@connection.exec("SELECT currval('#{sequence_name}')")[0][0]
     313          Integer(select_value("SELECT currval('#{sequence_name}')")
    314314        end 
    315315