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

Changeset 8860

Show
Ignore:
Timestamp:
02/12/08 20:11:50 (5 months ago)
Author:
nzkoz
Message:

2-0-stable: Remove table quoting; only pull last_insert_id if there's a primary key.

Merging [8663]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2-0-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

    r8254 r8860  
    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