refactor solution for #3804

This commit is contained in:
Albert Yi
2018-08-07 13:31:45 -07:00
parent d053e135ab
commit b56681a609
5 changed files with 25 additions and 16 deletions

View File

@@ -2,18 +2,4 @@ class UploadPresenter < Presenter
def initialize(upload)
@upload = upload
end
def status(template)
case @upload.status
when /duplicate: (\d+)/
dup_post_id = $1
template.link_to(@upload.status.gsub(/error: RuntimeError - /, ""), template.__send__(:post_path, dup_post_id))
when /\Aerror: /
@upload.status.gsub(/DETAIL:.+/m, "...")
else
@upload.status
end
end
end