From 2a39a2d454f7726ba5fc3fb1d8b3e89856704a4b Mon Sep 17 00:00:00 2001 From: Joerg Reichert Date: Sun, 30 Apr 2023 01:00:24 +0200 Subject: [PATCH] truncate direct method --- app/models/paper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/paper.rb b/app/models/paper.rb index e13a392..07ab7ea 100644 --- a/app/models/paper.rb +++ b/app/models/paper.rb @@ -80,7 +80,7 @@ class Paper < ActiveRecord::Base def import_from_json(json_string) old_count = count JSON.parse(json_string).each do |record| - content = truncate(record['content'], 99998) + content = record['content'].truncate(99998) attributes = { body: record['body'], content: content,