From c7d108ec1621bdb5b801147b08f5eb28013f6aa4 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Fri, 23 Nov 2018 20:52:07 +0100 Subject: [PATCH] Update according to Hound Closes [SCI-2790] --- app/helpers/protocols_io_helper.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/helpers/protocols_io_helper.rb b/app/helpers/protocols_io_helper.rb index 7ea8c58c3..e7fba085d 100644 --- a/app/helpers/protocols_io_helper.rb +++ b/app/helpers/protocols_io_helper.rb @@ -282,13 +282,12 @@ module ProtocolsIoHelper def pio_stp(iterating_key, parse_elements_array, en_local_text) append = '' parse_elements_array.each do |element| - if iterating_key[element] - append += fill_attributes( - element, - iterating_key[element], - en_local_text - ) - end + next unless iterating_key[element] + append += fill_attributes( + element, + iterating_key[element], + en_local_text + ) end append end @@ -350,11 +349,10 @@ module ProtocolsIoHelper elsif json_hash[e].present? if e == 'published_on' data = Time.at(json_hash[e]).utc.to_datetime.to_s - unshortened_string_for_tables += data else data = json_hash[e] - unshortened_string_for_tables += data end + unshortened_string_for_tables += data new_e = '' + e.humanize + '' image_tag = allowed_image_attributes.include?(e) ? Array('img') : Array(nil) description_string +=