Fix deprecations in opclasses initializer

The use of `table_exists?` in the opclasses support initializer triggers
a deprecation warning. Using `data_source_exists?` removes this
deprecation.
This commit is contained in:
Yorick Peterse 2018-12-12 17:11:23 +01:00
parent 40ad7d5d7a
commit 25ea6fdd5e
No known key found for this signature in database
GPG Key ID: EDD30D2BEB691AC9
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ module ActiveRecord
if index_name.length > max_index_length
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{max_index_length} characters"
end
if table_exists?(table_name) && index_name_exists?(table_name, index_name, false)
if data_source_exists?(table_name) && index_name_exists?(table_name, index_name, false)
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' already exists"
end
index_columns = quoted_columns_for_index(column_names, options).join(", ")