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 @@ ...@@ -2,11 +2,11 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{annotate} 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.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Marcos Piccinini"] s.authors = ["Marcos Piccinini"]
s.date = %q{2008-12-28} s.date = %q{2009-02-14}
s.default_executable = %q{annotate} s.default_executable = %q{annotate}
s.description = %q{Annotates Rails Models and Routes} s.description = %q{Annotates Rails Models and Routes}
s.email = ["x@nofxx.com"] s.email = ["x@nofxx.com"]
......
...@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless ...@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
module Annotate module Annotate
VERSION = '2.2.5' VERSION = '2.2.6'
end end
begin begin
......
...@@ -39,7 +39,7 @@ module AnnotateModels ...@@ -39,7 +39,7 @@ module AnnotateModels
max_size = klass.column_names.collect{|name| name.size}.max + 1 max_size = klass.column_names.collect{|name| name.size}.max + 1
klass.columns.each do |col| klass.columns.each do |col|
attrs = [] 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 << "not null" unless col.null
attrs << "primary key" if col.name == klass.primary_key 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