From 457e6c77d421a36b763441a2c262f580114a20d5 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 3 Oct 2016 07:35:54 +0900 Subject: Deprecate passing `name` to `indexes` like `tables` Passing `name` to `tables` is already deprecated at #21601. Passing `name` to `indexes` is also unused. --- .../connection_adapters/postgresql/schema_statements.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 85836fc575..bfda113e40 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -166,7 +166,13 @@ module ActiveRecord end # Returns an array of indexes for the given table. - def indexes(table_name, name = nil) + def indexes(table_name, name = nil) # :nodoc: + if name + ActiveSupport::Deprecation.warn(<<-MSG.squish) + Passing name to #indexes is deprecated without replacement. + MSG + end + table = Utils.extract_schema_qualified_name(table_name.to_s) result = query(<<-SQL, "SCHEMA") -- cgit v1.2.3