Commit 25ea6fdd authored by Yorick Peterse's avatar Yorick Peterse

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.
parent 40ad7d5d
...@@ -81,7 +81,7 @@ module ActiveRecord ...@@ -81,7 +81,7 @@ module ActiveRecord
if index_name.length > max_index_length 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" raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{max_index_length} characters"
end 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" raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' already exists"
end end
index_columns = quoted_columns_for_index(column_names, options).join(", ") index_columns = quoted_columns_for_index(column_names, options).join(", ")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment