diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-10-03 07:03:11 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-13 12:33:56 +0900 |
commit | 5e67187979e56b9cad666abe40ca86a89f304f8f (patch) | |
tree | e337c7f07d7eb3a1dfe49bc5d5b2f3c829942b20 /activerecord/lib/active_record/migration | |
parent | c6b4b4a52c7ec66d1923ef44dcbc71b582d7b165 (diff) | |
download | rails-5e67187979e56b9cad666abe40ca86a89f304f8f.tar.gz rails-5e67187979e56b9cad666abe40ca86a89f304f8f.tar.bz2 rails-5e67187979e56b9cad666abe40ca86a89f304f8f.zip |
The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r-- | activerecord/lib/active_record/migration/compatibility.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb index ffb54f5137..85032ce470 100644 --- a/activerecord/lib/active_record/migration/compatibility.rb +++ b/activerecord/lib/active_record/migration/compatibility.rb @@ -145,13 +145,13 @@ module ActiveRecord def index_name_for_remove(table_name, options = {}) index_name = index_name(table_name, options) - unless index_name_exists?(table_name, index_name, true) + unless index_name_exists?(table_name, index_name) if options.is_a?(Hash) && options.has_key?(:name) options_without_column = options.dup options_without_column.delete :column index_name_without_column = index_name(table_name, options_without_column) - return index_name_without_column if index_name_exists?(table_name, index_name_without_column, false) + return index_name_without_column if index_name_exists?(table_name, index_name_without_column) end raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' does not exist" |