From b25933f296e9f03e0e5c12d62f3d965a287b6671 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Mon, 26 Sep 2005 02:02:55 +0000 Subject: [PATCH] Get rid of warnings generated by calling obsolete .to_a method on a Symbol git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../connection_adapters/abstract/schema_statements.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 2ce1380f96..81ddb3e2bb 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -54,12 +54,12 @@ def rename_column(table_name, column_name, new_column_name) end # Create a new index on the given table. By default, it will be named - # "#{table_name}_#{column_name.to_a.first}_index", but you + # "#{table_name}_#{Array(column_name).first}_index", but you # can explicitly name the index by passing :name => "..." # as the last parameter. Unique indexes may be created by passing # :unique => true. def add_index(table_name, column_name, options = {}) - index_name = "#{table_name}_#{column_name.to_a.first}_index" + index_name = "#{table_name}_#{Array(column_name).first}_index" if Hash === options # legacy support, since this param was a string index_type = options[:unique] ? "UNIQUE" : "" @@ -68,7 +68,7 @@ def add_index(table_name, column_name, options = {}) index_type = options end - execute "CREATE #{index_type} INDEX #{index_name} ON #{table_name} (#{column_name.to_a.join(", ")})" + execute "CREATE #{index_type} INDEX #{index_name} ON #{table_name} (#{Array(column_name).join(", ")})" end # Remove the given index from the table. @@ -134,4 +134,4 @@ def add_column_options!(sql, options) #:nodoc: end end end -end \ No newline at end of file +end -- GitLab