Skip to content

Commit 18cd39a

Browse files
committed
Merge pull request #79 from phallstrom/master
One line patch to sort the indexes by name.
2 parents ff1131d + b438a77 commit 18cd39a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def get_index_info(klass)
101101
return "" if indexes.empty?
102102

103103
max_size = indexes.collect{|index| index.name.size}.max + 1
104-
indexes.each do |index|
104+
indexes.sort_by{|index| index.name}.each do |index|
105105
index_info << sprintf("# %-#{max_size}.#{max_size}s %s %s", index.name, "(#{index.columns.join(",")})", index.unique ? "UNIQUE" : "").rstrip + "\n"
106106
end
107107
return index_info

0 commit comments

Comments
 (0)