aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-02-19 15:31:56 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-02-19 15:31:56 -0800
commit2df891dccdcfbdfb176c55297589712ac379f87d (patch)
tree0d2505faeaa910c2ef84ebcd70f45ab5d62bed99 /activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
parente0c6156c693efffd8009a116a96f7ff631e4db47 (diff)
downloadrails-2df891dccdcfbdfb176c55297589712ac379f87d.tar.gz
rails-2df891dccdcfbdfb176c55297589712ac379f87d.tar.bz2
rails-2df891dccdcfbdfb176c55297589712ac379f87d.zip
eliminate warnings about multiple primary keys on habtm join tables
habtm join tables commonly have two id columns and it's OK to make those two id columns a primary key. This commit eliminates the warnings for join tables that have this setup. ManageIQ/manageiq#6713
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb2
1 files changed, 1 insertions, 1 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 6aa264d766..6f2e03b370 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
@@ -118,7 +118,7 @@ module ActiveRecord
alias :exec_update :exec_delete
def sql_for_insert(sql, pk, id_value, sequence_name, binds) # :nodoc:
- unless pk
+ if pk.nil?
# Extract the table from the insert sql. Yuck.
table_ref = extract_table_ref_from_insert_sql(sql)
pk = primary_key(table_ref) if table_ref