aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Barron <scott@elitists.net>2005-12-20 20:24:19 +0000
committerScott Barron <scott@elitists.net>2005-12-20 20:24:19 +0000
commit1235d26bfbc99a7b7466bddb8ff69eecc585d27f (patch)
tree1619ca9b5d6837f5be01fb4668ea269207fa42b7
parent233208b8bb638bab3ee7f8f88e227fa7d8ee9c7e (diff)
downloadrails-1235d26bfbc99a7b7466bddb8ff69eecc585d27f.tar.gz
rails-1235d26bfbc99a7b7466bddb8ff69eecc585d27f.tar.bz2
rails-1235d26bfbc99a7b7466bddb8ff69eecc585d27f.zip
Check for the key instead of the value, because it (the value) can be false.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3322 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 8f2ba6e6c4..76b72f3bd1 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -298,7 +298,7 @@ module ActiveRecord
def add_column(table_name, column_name, type, options = {})
native_type = native_database_types[type]
sql_commands = ["ALTER TABLE #{table_name} ADD #{column_name} #{type_to_sql(type, options[:limit])}"]
- if options[:default]
+ if options.has_key?(:default)
sql_commands << "ALTER TABLE #{table_name} ALTER #{column_name} SET DEFAULT '#{options[:default]}'"
end
if options[:null] == false