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

Changeset 8663

Show
Ignore:
Timestamp:
01/19/08 02:43:31 (4 months ago)
Author:
bitsweat
Message:

Remove table quoting; only pull last_insert_id if there's a primary key.

Files:

Legend:

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

    r8650 r8663  
    387387      # Executes an INSERT query and returns the new record's ID 
    388388      def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) 
    389         table = sql.split(" ", 4)[2] 
    390         super || last_insert_id(table, sequence_name || default_sequence_name(table, pk)) 
     389        table = sql.split(" ", 4)[2].gsub('"', '') 
     390        super || pk && last_insert_id(table, sequence_name || default_sequence_name(table, pk)) 
    391391      end 
    392392