Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/annotate/annotate_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.type || col.sql_type).to_s
col_type = (col.sql_type || col.type).to_s
if col_type == "decimal"
col_type << "(#{col.precision}, #{col.scale})"
elsif col_type != "spatial"
Expand Down
2 changes: 1 addition & 1 deletion spec/annotate/annotate_models_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def mock_column(name, type, options={})

stubs = default_options.dup
stubs.merge!(options)
stubs.merge!(:name => name, :type => type)
stubs.merge!(:name => name, :sql_type => type, :type => type)

double("Column", stubs)
end
Expand Down