rename sort method

This commit is contained in:
Mike Greiling 2016-12-27 09:59:42 -06:00
parent 713e8cf2eb
commit 1c5a506588
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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 }