gitlab-org--gitlab-foss/app/presenters/ci/build_presenter.rb
Rémy Coutable 061bb6eb6e More improvements to presenters
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-18 16:38:35 +01:00

15 lines
348 B
Ruby

module Ci
class BuildPresenter < Gitlab::View::Presenter::Delegated
presents :build
def erased_by_user?
# Build can be erased through API, therefore it does not have
# `erased_by` user assigned in that case.
erased? && erased_by
end
def erased_by_name
erased_by.name if erased_by_user?
end
end
end