diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-10 18:02:57 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-10 22:45:14 -0700 |
commit | 1f3d3eb49d16b62250c24e3374cc36de99b397b8 (patch) | |
tree | ee97f2fca4cafb4dd2a733399a155e5b7208baf0 /activerecord | |
parent | d6edaeeaf8b6c0f0b741c0827ab6e091bdd4e197 (diff) | |
download | rails-1f3d3eb49d16b62250c24e3374cc36de99b397b8.tar.gz rails-1f3d3eb49d16b62250c24e3374cc36de99b397b8.tar.bz2 rails-1f3d3eb49d16b62250c24e3374cc36de99b397b8.zip |
pg should define insert_sql so that query cache actually works for inserts
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 3 |
1 files changed, 1 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 acd4c5cc4a..7546afcc18 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -431,7 +431,7 @@ module ActiveRecord end # Executes an INSERT query and returns the new record's ID - def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) + def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) # Extract the table from the insert sql. Yuck. table = sql.split(" ", 4)[2].gsub('"', '') @@ -440,7 +440,6 @@ module ActiveRecord pk, sequence_name = *pk_and_sequence_for(table) unless pk if pk id = select_value("#{sql} RETURNING #{quote_column_name(pk)}") - clear_query_cache return id end end |