diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-09 08:52:44 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-09 08:52:44 -0300 |
commit | fa34acec20574699c2de19d97f9ae54f540fe69d (patch) | |
tree | dc37c85a77762bdcae529dab845ff4ed081e082a /activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | |
parent | cb242a9e4808af7a2aab19832846e2947e39e4a0 (diff) | |
download | rails-fa34acec20574699c2de19d97f9ae54f540fe69d.tar.gz rails-fa34acec20574699c2de19d97f9ae54f540fe69d.tar.bz2 rails-fa34acec20574699c2de19d97f9ae54f540fe69d.zip |
Stop showing deprecations for Ruby 1.8.7 with remove_column
String is Enumerable in 1.8.7, which means that passing a String to
remove_column was generating deprecation warnings during tests.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 91929f80d2..00f74318c0 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -408,13 +408,13 @@ module ActiveRecord def remove_column(table_name, *column_names) #:nodoc: raise ArgumentError.new("You must specify at least one column name. Example: remove_column(:people, :first_name)") if column_names.empty? - if column_names.first.kind_of?(Enumerable) + if column_names.flatten! message = 'Passing array to remove_columns is deprecated, please use ' + 'multiple arguments, like: `remove_columns(:posts, :foo, :bar)`' ActiveSupport::Deprecation.warn message, caller end - column_names.flatten.each do |column_name| + column_names.each do |column_name| alter_table(table_name) do |definition| definition.columns.delete(definition[column_name]) end |