From 56fa07aa2173ad13e64d647b00fab631b4d97676 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 24 Aug 2021 10:19:30 +0200 Subject: [PATCH] Moved max item name length to constant [SCI-6025] --- app/controllers/repository_rows_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index 495159145..5d727bdf4 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -4,6 +4,8 @@ class RepositoryRowsController < ApplicationController include ApplicationHelper include MyModulesHelper + MAX_PRINTABLE_ITEM_NAME_LENGTH = 64 + before_action :load_repository, except: :show before_action :load_repository_row, only: %i(update assigned_task_list) before_action :check_read_permissions, except: %i(show create update delete_records copy_records) @@ -99,7 +101,7 @@ class RepositoryRowsController < ApplicationController label_printer, LabelTemplate.first.render( # Currently we will only use the default template item_id: repository_row.code, - item_name: repository_row.name.truncate(64) + item_name: repository_row.name.truncate(MAX_PRINTABLE_ITEM_NAME_LENGTH) ), params[:copies].to_i ).job_id