diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-05 16:10:09 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-11 15:19:53 +0900 |
commit | 6d1440db3eb77170c461d7dab6d43a978a988fae (patch) | |
tree | bce26cd775f93dafe4a5859eea60a4827fa8e9c4 /activerecord/lib | |
parent | 6401e03ef6285a93588a162e651e0b15fcb60a19 (diff) | |
download | rails-6d1440db3eb77170c461d7dab6d43a978a988fae.tar.gz rails-6d1440db3eb77170c461d7dab6d43a978a988fae.tar.bz2 rails-6d1440db3eb77170c461d7dab6d43a978a988fae.zip |
Fix `remove_reference` to multiple foreign keys in the same table
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 8de8c05988..dff84613a8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -856,6 +856,7 @@ module ActiveRecord else foreign_key_options = { to_table: reference_name } end + foreign_key_options[:column] ||= "#{ref_name}_id" remove_foreign_key(table_name, **foreign_key_options) end |