diff options
author | francis <francis> | 2008-01-22 19:41:32 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-22 19:41:32 +0000 |
commit | 969ba4ee40d1cb28625a01cbaa9231cc17dffb82 (patch) | |
tree | 6d42080d2575daa1d6a405179721f7228553623b | |
parent | 5aea98e6bacb72b718cdaa58088fc6b07646abd7 (diff) |
Bit of a silly bug!
-rw-r--r-- | vendor/plugins/annotate_models/lib/annotate_models.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/plugins/annotate_models/lib/annotate_models.rb b/vendor/plugins/annotate_models/lib/annotate_models.rb index 1d84113af..8af7be116 100644 --- a/vendor/plugins/annotate_models/lib/annotate_models.rb +++ b/vendor/plugins/annotate_models/lib/annotate_models.rb @@ -10,9 +10,9 @@ module AnnotateModels # Simple quoting for the default column value def self.quote(value) case value - when NilClass then "NULL" - when TrueClass then "TRUE" - when FalseClass then "FALSE" + when NilClass then "null" + when TrueClass then "true" + when FalseClass then "false" when Float, Fixnum, Bignum then value.to_s # BigDecimals need to be output in a non-normalized form and quoted. when BigDecimal then value.to_s('F') @@ -32,7 +32,7 @@ module AnnotateModels max_size = klass.column_names.collect{|name| name.size}.max + 1 klass.columns.each do |col| attrs = [] - attrs << "default(#{quote(col.default)})" if col.default + attrs << "default(#{quote(col.default)})" if !col.default.nil? attrs << "not null" unless col.null attrs << "primary key" if col.name == klass.primary_key |