Browse files

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
  • Loading branch information...
1 parent 233208b commit 1235d26bfbc99a7b7466bddb8ff69eecc585d27f Scott Barron committed Dec 20, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
2 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -298,7 +298,7 @@ def rename_table(name, new_name)
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

0 comments on commit 1235d26

Please sign in to comment.