public
Fork of NZKoz/koz-rails
Description: Koz's rails git-svn clone
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/eventualbuddha/koz-rails.git
2-0-stable: Remove table quoting; only pull last_insert_id if there's a 
primary key.

Merging [8663]


git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/2-0-stable@8860 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
nzkoz (author)
Tue Feb 12 12:11:50 -0800 2008
commit  69e7c953dea2bdf695277cd5fd278ae68585d716
tree    b1a31e80da871725085dff8742aa6745468bd98f
parent  3ebcb94028b0ab3857d212a10ba4fe5e84ab6eb8
...
386
387
388
389
390
 
 
391
392
393
...
386
387
388
 
 
389
390
391
392
393
0
@@ -386,8 +386,8 @@ module ActiveRecord
0
 
0
       # Executes an INSERT query and returns the new record's ID
0
       def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
0
- table = sql.split(" ", 4)[2]
0
- super || last_insert_id(table, sequence_name || default_sequence_name(table, pk))
0
+ table = sql.split(" ", 4)[2].gsub('"', '')
0
+ super || pk && last_insert_id(table, sequence_name || default_sequence_name(table, pk))
0
       end
0
 
0
       # Queries the database and returns the results in an Array or nil otherwise.

Comments

    No one has commented yet.