Commit 7a85f89f by Miguel Herranz

Write default(FALSE) when the default value for a column is false.

Before this change only default(TRUE) was written.
parent ed05a78e
......@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{annotate}
s.version = "2.2.5"
s.version = "2.2.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Marcos Piccinini"]
s.date = %q{2008-12-28}
s.date = %q{2009-02-14}
s.default_executable = %q{annotate}
s.description = %q{Annotates Rails Models and Routes}
s.email = ["x@nofxx.com"]
......
......@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
module Annotate
VERSION = '2.2.5'
VERSION = '2.2.6'
end
begin
......
......@@ -39,7 +39,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)})" unless col.default.nil?
attrs << "not null" unless col.null
attrs << "primary key" if col.name == klass.primary_key
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment