diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-13 09:22:22 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-13 11:19:45 +0200 |
commit | 93b555af85ff124820366855ed9b3a9fa719c272 (patch) | |
tree | ed23bb4b6c87656373c0bdab3941fe8a4bb935ad /app/models/commit_status.rb | |
parent | de20057ccbd3b8c94d64ff5d8deb14cab232d08a (diff) | |
download | gitlab-ce-93b555af85ff124820366855ed9b3a9fa719c272.tar.gz |
Handle legacy jobs without namezj-commit-status-sortable-name
Older pipelines can contain jobs without a name, in which case
'nameless' is used right now, so we can properly still handle other
actions on these jobs.
Fixes gitlab-org/gitlab-ce#33403
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index cb425706a9e..07cec63b939 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -112,7 +112,7 @@ class CommitStatus < ActiveRecord::Base end def group_name - name.gsub(/\d+[\s:\/\\]+\d+\s*/, '').strip + name.to_s.gsub(/\d+[\s:\/\\]+\d+\s*/, '').strip end def failed_but_allowed? @@ -156,7 +156,7 @@ class CommitStatus < ActiveRecord::Base end def sortable_name - name.split(/(\d+)/).map do |v| + name.to_s.split(/(\d+)/).map do |v| v =~ /\d+/ ? v.to_i : v end end |