diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-18 03:05:33 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-18 04:51:45 +0900 |
commit | c48630b1ce1d7cf7e6a30f1eafd28ccedcc256ed (patch) | |
tree | 6f3b961d565b5816d52d55742e4e7999c0b91ef1 /activerecord/lib | |
parent | 6568cfd78c89fe70ac7304d03f8f4825fe0b7c72 (diff) | |
download | rails-c48630b1ce1d7cf7e6a30f1eafd28ccedcc256ed.tar.gz rails-c48630b1ce1d7cf7e6a30f1eafd28ccedcc256ed.tar.bz2 rails-c48630b1ce1d7cf7e6a30f1eafd28ccedcc256ed.zip |
Remove unnecessary `test_sql_for_insert_with_returning_disabled`
Because `sql_for_insert` is only called in `use_insert_returning?` is
true since #26002.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb index 46aca2ab54..7414eba6c5 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb @@ -124,14 +124,13 @@ module ActiveRecord pk = primary_key(table_ref) if table_ref end - pk = suppress_composite_primary_key(pk) - - if pk && use_insert_returning? + if pk = suppress_composite_primary_key(pk) sql = "#{sql} RETURNING #{quote_column_name(pk)}" end super end + protected :sql_for_insert def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) if use_insert_returning? || pk == false |