diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-09-04 11:18:41 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-09-04 11:18:41 +0300 |
commit | a343484bdf6de75383c4667cc6b161a5c47dbeef (patch) | |
tree | 1d14ed7e2d6f4a84baa30b76d5f37a54ebe12fa1 /lib | |
parent | 70c347f01a6298af3937e4057ef6a2675e92510f (diff) | |
parent | ed8f7ed671a5fb6197c9e4759bf13742cf967f50 (diff) |
Merge branch 'zj-sort-templates' into 'master'
Sort templates when fetching them
Closes #37153
See merge request !13920
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/template/base_template.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb index 7ebec8e2cff..7393574ac13 100644 --- a/lib/gitlab/template/base_template.rb +++ b/lib/gitlab/template/base_template.rb @@ -18,6 +18,10 @@ module Gitlab { name: name, content: content } end + def <=>(other) + name <=> other.name + end + class << self def all(project = nil) if categories.any? @@ -58,7 +62,7 @@ module Gitlab directory = category_directory(category) files = finder(project).list_files_for(directory) - files.map { |f| new(f, project) } + files.map { |f| new(f, project) }.sort end def category_directory(category) |