From 451d14c2e91737cc8c49048c606d386e31e9326a Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Mon, 5 Mar 2018 16:48:18 +0100 Subject: [PATCH] Added 4 to constants too, then fixed line too long error --- app/helpers/protocols_io_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/protocols_io_helper.rb b/app/helpers/protocols_io_helper.rb index 069f313aa..769d09210 100644 --- a/app/helpers/protocols_io_helper.rb +++ b/app/helpers/protocols_io_helper.rb @@ -57,7 +57,12 @@ module ProtocolsIoHelper tables[table_counter.to_s] = {} tr_number = table[0].scan(tr_regex).count diff = PIO_TABLE_MIN_HEIGHT - tr_number # always tables have atleast 5 row - table_fix_str = tr_number > 4 ? table[0] : table[0] + '' * diff + table_fix_str = + if tr_number >= PIO_TABLE_MIN_HEIGHT + table[0] + else + table[0] + '' * diff + end tr_strings = table_fix_str.scan(tr_regex) contents = {} contents['data'] = []