From 3cc83a8f24ba61b648a2728efc113388cf1ec243 Mon Sep 17 00:00:00 2001 From: Grant Neufeld Date: Sat, 18 Jun 2011 14:38:38 -0600 Subject: Changed the default value for the options argument on ActiveRecord::ConnectionAdapters::Table#column_exists? from nil to an empty Hash {}. That method calls through to ActiveRecord::ConnectionAdapters::SchemaStatements##column_exists? expects options to be a Hash. When options was nil, an error would occur in cases where the column did exist because the called method attempted to perform a key lookup on options. --- .../active_record/connection_adapters/abstract/schema_definitions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index a9e3c83eb0..82f564e41d 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -328,7 +328,7 @@ module ActiveRecord end # Checks to see if a column exists. See SchemaStatements#column_exists? - def column_exists?(column_name, type = nil, options = nil) + def column_exists?(column_name, type = nil, options = {}) @base.column_exists?(@table_name, column_name, type, options) end -- cgit v1.2.3