aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-06 00:53:29 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-06 01:04:33 -0300
commit2958a1e14e1636ae84d3580f4c7a5a7baeab2b8b (patch)
tree4407fa7eeda29e19f67555a0c566b00630ba73f1 /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
parent2a663dcf09b380279b22537db6a7caaefdf8b961 (diff)
downloadrails-2958a1e14e1636ae84d3580f4c7a5a7baeab2b8b.tar.gz
rails-2958a1e14e1636ae84d3580f4c7a5a7baeab2b8b.tar.bz2
rails-2958a1e14e1636ae84d3580f4c7a5a7baeab2b8b.zip
Remove Array.wrap calls in ActiveRecord
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb9
1 files changed, 4 insertions, 5 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 20d3b4a1ef..54393e24a3 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -1,4 +1,3 @@
-require 'active_support/core_ext/array/wrap'
require 'active_support/deprecation/reporting'
module ActiveRecord
@@ -42,7 +41,7 @@ module ActiveRecord
# # Check an index with a custom name exists
# index_exists?(:suppliers, :company_id, :name => "idx_company_id"
def index_exists?(table_name, column_name, options = {})
- column_names = Array.wrap(column_name)
+ column_names = Array(column_name)
index_name = options.key?(:name) ? options[:name].to_s : index_name(table_name, :column => column_names)
if options[:unique]
indexes(table_name).any?{ |i| i.unique && i.name == index_name }
@@ -377,7 +376,7 @@ module ActiveRecord
def index_name(table_name, options) #:nodoc:
if Hash === options # legacy support
if options[:column]
- "index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}"
+ "index_#{table_name}_on_#{Array(options[:column]) * '_and_'}"
elsif options[:name]
options[:name]
else
@@ -436,7 +435,7 @@ module ActiveRecord
end
def assume_migrated_upto_version(version, migrations_paths = ActiveRecord::Migrator.migrations_paths)
- migrations_paths = Array.wrap(migrations_paths)
+ migrations_paths = Array(migrations_paths)
version = version.to_i
sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name)
@@ -551,7 +550,7 @@ module ActiveRecord
end
def add_index_options(table_name, column_name, options = {})
- column_names = Array.wrap(column_name)
+ column_names = Array(column_name)
index_name = index_name(table_name, :column => column_names)
if Hash === options # legacy support, since this param was a string