Exclude content attribute of files to be trimmed

This commit is contained in:
Sebastian Serth
2021-10-08 19:20:57 +02:00
parent 9374334bef
commit 6a255ced5b

View File

@ -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