mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Check if the options value is present before to send the deprecation
message
This commit is contained in:
parent
c449462f45
commit
fa0aebf320
2 changed files with 8 additions and 6 deletions
|
@ -629,11 +629,13 @@ module ActiveRecord
|
|||
index_options = options[:where] ? " WHERE #{options[:where]}" : ""
|
||||
end
|
||||
else
|
||||
if options
|
||||
message = "Passing a string as third argument of `add_index` is deprecated and will" +
|
||||
" be removed in Rails 4.1." +
|
||||
" Use add_index(#{table_name.inspect}, #{column_name.inspect}, unique: true) instead"
|
||||
|
||||
ActiveSupport::Deprecation.warn message
|
||||
end
|
||||
|
||||
index_type = options
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue