aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-09-26 02:02:55 +0000
committerMarcel Molina <marcel@vernix.org>2005-09-26 02:02:55 +0000
commitb25933f296e9f03e0e5c12d62f3d965a287b6671 (patch)
tree84e61b451f84e4c00600985a319418cb57424ca4
parentc5f53ca33366062da987706704c27e516fe8cc3b (diff)
downloadrails-b25933f296e9f03e0e5c12d62f3d965a287b6671.tar.gz
rails-b25933f296e9f03e0e5c12d62f3d965a287b6671.tar.bz2
rails-b25933f296e9f03e0e5c12d62f3d965a287b6671.zip
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
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb8
1 files 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 @@ module ActiveRecord
end
# Create a new index on the given table. By default, it will be named
- # <code>"#{table_name}_#{column_name.to_a.first}_index"</code>, but you
+ # <code>"#{table_name}_#{Array(column_name).first}_index"</code>, but you
# can explicitly name the index by passing <code>:name => "..."</code>
# as the last parameter. Unique indexes may be created by passing
# <code>:unique => true</code>.
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 @@ module ActiveRecord
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 @@ module ActiveRecord
end
end
end
-end \ No newline at end of file
+end