From e8b02b2e0ab9cf17ef231dcbceb07e7ab0fda692 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 27 Oct 2020 01:14:13 +0100 Subject: [PATCH] Submission file_by_name: Improve comment --- app/models/submission.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/submission.rb b/app/models/submission.rb index 6ff1894a..b37af71a 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -55,6 +55,8 @@ class Submission < ApplicationRecord def file_by_name(file_path) # expects the full file path incl. file extension + # Caution: There must be no unnecessary path prefix included. + # Use `file.ext` rather than `./file.ext` collect_files.detect { |file| file.filepath == file_path } end