diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-02-16 09:08:08 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-02-16 09:08:08 +0100 |
commit | 8980da84bc33b0e2b36c92362d74280658441581 (patch) | |
tree | 7271d10433856bab64baf35bc773da941161de53 | |
parent | b824dfd44bf2dd932d6d955ac868af1020f0099a (diff) | |
download | rails-8980da84bc33b0e2b36c92362d74280658441581.tar.gz rails-8980da84bc33b0e2b36c92362d74280658441581.tar.bz2 rails-8980da84bc33b0e2b36c92362d74280658441581.zip |
fix, `to_table` in `remove_foreign_key` should be plural.
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 |
1 files changed, 1 insertions, 1 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 c9180f64db..8217468024 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -667,7 +667,7 @@ module ActiveRecord # remove_reference(:products, :user, index: true, foreign_key: true) # def remove_reference(table_name, ref_name, options = {}) - remove_foreign_key table_name, ref_name if options[:foreign_key] + remove_foreign_key table_name, ref_name.to_s.pluralize if options[:foreign_key] remove_column(table_name, "#{ref_name}_id") remove_column(table_name, "#{ref_name}_type") if options[:polymorphic] |