From 25ea6fdd5ee723dbe98b719c9966b19668cb7cda Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 12 Dec 2018 17:11:23 +0100 Subject: [PATCH] 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. --- config/initializers/postgresql_opclasses_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb index 07b06629dea..5d643b75dd8 100644 --- a/config/initializers/postgresql_opclasses_support.rb +++ b/config/initializers/postgresql_opclasses_support.rb @@ -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(", ")