From 6a255ced5bf9a4968b16f3765f225751477815dd Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Fri, 8 Oct 2021 19:20:57 +0200 Subject: [PATCH] Exclude content attribute of files to be trimmed --- app/models/application_record.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 43c3e9aa..a851eca6 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -7,7 +7,8 @@ class ApplicationRecord < ActiveRecord::Base def strip_strings # trim whitespace from beginning and end of string attributes - attribute_names.each do |name| + # except for the `content` of CodeOcean::Files + attribute_names.without('content').each do |name| if send(name.to_sym).respond_to?(:strip) send("#{name}=".to_sym, send(name).strip) end