Commit 5286f96b by Jon Frisby

Merge remote-tracking branch 'prophotos/custom_types_compatibility'

Conflicts: lib/annotate/annotate_models.rb
parents 06ebbd19 217fc9c5
......@@ -60,7 +60,7 @@ module AnnotateModels
attrs << "not null" unless col.null
attrs << "primary key" if col.name == klass.primary_key
col_type = col.type.to_s
col_type = (col.type || col.sql_type).to_s
if col_type == "decimal"
col_type << "(#{col.precision}, #{col.scale})"
else
......@@ -148,7 +148,7 @@ module AnnotateModels
if new_content == old_content
old_content.sub!(encoding, '')
new_content = options[:position] == 'after' ?
(encoding_header + (old_content =~ /\n$/ ? old_content : old_content + '\n') + info_block) :
(encoding_header + (old_content.rstrip + "\n\n" + info_block)) :
(encoding_header + info_block + old_content)
end
......
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