summaryrefslogtreecommitdiff
path: root/app/helpers/runners_helper.rb
diff options
context:
space:
mode:
authorAlexander Kutelev <alexander@kutelev.ru>2019-01-04 12:54:45 +0700
committerAlexander Kutelev <alexander.kutelev@neulion.com>2019-01-04 13:24:42 +0700
commitbcaf444b2107408b1eaf66bfc0d869b7b87b35f9 (patch)
tree3af6bf54ea79b85bd5d6846e03abcecfe60c7352 /app/helpers/runners_helper.rb
parentd56124b5e16e15afd830a1bdc8c34a4a57d898d8 (diff)
downloadgitlab-ce-bcaf444b2107408b1eaf66bfc0d869b7b87b35f9.tar.gz
Take contacted_at value from the DB when it is about to be displayed in the Web interface with sorting enabled.
Diffstat (limited to 'app/helpers/runners_helper.rb')
-rw-r--r--app/helpers/runners_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb
index cb21f922401..0d880c38a7b 100644
--- a/app/helpers/runners_helper.rb
+++ b/app/helpers/runners_helper.rb
@@ -28,4 +28,14 @@ module RunnersHelper
display_name + id
end
end
+
+ # Due to inability of performing sorting of runners by cached "contacted_at" values we have to show uncached values if sorting by "contacted_asc" is requested.
+ # Please refer to the following issue for more details: https://gitlab.com/gitlab-org/gitlab-ce/issues/55920
+ def runner_contacted_at(runner)
+ if params[:sort] == 'contacted_asc'
+ runner.uncached_contacted_at
+ else
+ runner.contacted_at
+ end
+ end
end