diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-12-25 12:08:53 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-12-25 14:11:19 +0200 |
commit | 195dc3a7461468b060b9a9c6860aca37cebc9d8d (patch) | |
tree | a64253586d1da0f277fc75a101d199c607d291e1 /app/helpers | |
parent | a1b63e12526c069a8754b5e64deb9eb15668832a (diff) | |
download | gitlab-ce-195dc3a7461468b060b9a9c6860aca37cebc9d8d.tar.gz |
add sorting of awards
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/issues_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 4fe84322199..c1053554fbd 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -120,6 +120,18 @@ module IssuesHelper end end + def awards_sort(awards) + awards.sort_by do |award, notes| + if award == "thumbsup" + 0 + elsif award == "thumbsdown" + 1 + else + 2 + end + end.to_h + end + # Required for Banzai::Filter::IssueReferenceFilter module_function :url_for_issue end |