aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-04-29 16:28:11 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-04-29 16:33:01 +0900
commit0be7f45ae6ec6baa6b21cd9f59963e3422b6d070 (patch)
tree74216e133af962671ad8e8459b191c0e35833a2e
parent6003257b73e66df8cd00d4014724df1a31761381 (diff)
downloadrails-0be7f45ae6ec6baa6b21cd9f59963e3422b6d070.tar.gz
rails-0be7f45ae6ec6baa6b21cd9f59963e3422b6d070.tar.bz2
rails-0be7f45ae6ec6baa6b21cd9f59963e3422b6d070.zip
Restore original merging order to enforce `if_exists: true`
The merging order was accidentally changed at #32447. The original intention is force `drop_table ... if_exists: true`. #28070.
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb3
1 files changed, 1 insertions, 2 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 ac73337aef..54dc917e99 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -305,8 +305,7 @@ module ActiveRecord
yield td if block_given?
if options[:force]
- drop_opts = { if_exists: true }.merge(**options)
- drop_table(table_name, drop_opts)
+ drop_table(table_name, options.merge(if_exists: true))
end
result = execute schema_creation.accept td