From e2e6a2f8a92c31ae2fe2185d95c01c8c162a6e3c Mon Sep 17 00:00:00 2001 From: "cuong.tran" Date: Fri, 22 May 2015 14:24:39 -0700 Subject: [PATCH 1/2] Revert "Prefer SQL column type over normalized AR type" This reverts commit 067ce522944590351f7bc8ed6bfbf74f672a9562. --- lib/annotate/annotate_models.rb | 2 +- spec/annotate/annotate_models_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/annotate/annotate_models.rb b/lib/annotate/annotate_models.rb index c9267ebb7..b21520c63 100644 --- a/lib/annotate/annotate_models.rb +++ b/lib/annotate/annotate_models.rb @@ -140,7 +140,7 @@ def get_schema_info(klass, header, options = {}) attrs << "not null" unless col.null attrs << "primary key" if klass.primary_key && (klass.primary_key.is_a?(Array) ? klass.primary_key.collect{|c|c.to_sym}.include?(col.name.to_sym) : col.name.to_sym == klass.primary_key.to_sym) - col_type = (col.sql_type || col.type).to_s + col_type = (col.type || col.sql_type).to_s if col_type == "decimal" col_type << "(#{col.precision}, #{col.scale})" elsif col_type != "spatial" diff --git a/spec/annotate/annotate_models_spec.rb b/spec/annotate/annotate_models_spec.rb index d8695b9fb..f2b0f13db 100755 --- a/spec/annotate/annotate_models_spec.rb +++ b/spec/annotate/annotate_models_spec.rb @@ -45,7 +45,7 @@ def mock_column(name, type, options={}) stubs = default_options.dup stubs.merge!(options) - stubs.merge!(:name => name, :sql_type => type, :type => type) + stubs.merge!(:name => name, :type => type) double("Column", stubs) end From bcd2e8cd23abf5b1967d4d61027fe7b02f7c54b5 Mon Sep 17 00:00:00 2001 From: "cuong.tran" Date: Fri, 22 May 2015 14:25:11 -0700 Subject: [PATCH 2/2] v2.6.10 --- lib/annotate/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/annotate/version.rb b/lib/annotate/version.rb index 48b4d3237..e2343719c 100644 --- a/lib/annotate/version.rb +++ b/lib/annotate/version.rb @@ -1,5 +1,5 @@ module Annotate def self.version - '2.6.9' + '2.6.10' end end