mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix add_foreign_key
to prevent double prefix/suffix
This commit is contained in:
parent
dd5886d00a
commit
6951566f36
1 changed files with 1 additions and 1 deletions
|
@ -921,7 +921,7 @@ module ActiveRecord
|
||||||
unless connection.respond_to? :revert
|
unless connection.respond_to? :revert
|
||||||
unless arguments.empty? || [:execute, :enable_extension, :disable_extension].include?(method)
|
unless arguments.empty? || [:execute, :enable_extension, :disable_extension].include?(method)
|
||||||
arguments[0] = proper_table_name(arguments.first, table_name_options)
|
arguments[0] = proper_table_name(arguments.first, table_name_options)
|
||||||
if [:rename_table, :add_foreign_key].include?(method) ||
|
if method == :rename_table ||
|
||||||
(method == :remove_foreign_key && !arguments.second.is_a?(Hash))
|
(method == :remove_foreign_key && !arguments.second.is_a?(Hash))
|
||||||
arguments[1] = proper_table_name(arguments.second, table_name_options)
|
arguments[1] = proper_table_name(arguments.second, table_name_options)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue