From 8980da84bc33b0e2b36c92362d74280658441581 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 16 Feb 2015 09:08:08 +0100 Subject: fix, `to_table` in `remove_foreign_key` should be plural. --- .../lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') 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] -- cgit v1.2.3