diff options
author | Mike Greiling <mike@pixelcog.com> | 2016-12-27 09:59:42 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-02 11:44:08 -0600 |
commit | 1c5a506588342bdb2a6390f14d333d41a5482f58 (patch) | |
tree | fd38a706da38f2121c6defa2af2efb2dc34c0cc4 | |
parent | 713e8cf2eb5f5b46a355f9d76a49076c3b459d1c (diff) | |
download | gitlab-ce-1c5a506588342bdb2a6390f14d333d41a5482f58.tar.gz |
rename sort method
-rw-r--r-- | app/models/commit_status.rb | 2 | ||||
-rw-r--r-- | app/views/projects/stage/_graph.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 897e53fc7bd..9547c57b2ae 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -138,7 +138,7 @@ class CommitStatus < ActiveRecord::Base .fabricate! end - def natsort_name + def sortable_name name.split(/(\d+)/).map do |v| v =~ /\d+/ ? v.to_i : v end diff --git a/app/views/projects/stage/_graph.html.haml b/app/views/projects/stage/_graph.html.haml index faadcfee30c..4ee30b023ac 100644 --- a/app/views/projects/stage/_graph.html.haml +++ b/app/views/projects/stage/_graph.html.haml @@ -1,6 +1,6 @@ - stage = local_assigns.fetch(:stage) - statuses = stage.statuses.latest -- status_groups = statuses.sort_by(&:natsort_name).group_by(&:group_name) +- status_groups = statuses.sort_by(&:sortable_name).group_by(&:group_name) %li.stage-column .stage-name %a{ name: stage.name } |