1
0
Fork 0
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:
Rafael Mendonça França 2012-11-03 13:26:21 -02:00
parent c449462f45
commit fa0aebf320
2 changed files with 8 additions and 6 deletions

View file

@ -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