From 36782611b496f3d6265873af5944337249dd278a Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Thu, 9 Mar 2023 22:13:52 +0100 Subject: [PATCH] Fix hound [SCI-8007] --- app/assets/javascripts/protocols/index.js | 9 ++++++++- app/datatables/protocol_linked_children_datatable.rb | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/protocols/index.js b/app/assets/javascripts/protocols/index.js index 86c2690f9..aa26be05c 100644 --- a/app/assets/javascripts/protocols/index.js +++ b/app/assets/javascripts/protocols/index.js @@ -616,7 +616,14 @@ var ProtocolsIndex = (function() { columns: [ { data: '1' } ], - lengthMenu: [[10, 25, 50], ['Show 10 per page', 'Show 25 per page', 'Show 50 per page']], + lengthMenu: [ + [10, 25, 50], + [ + I18n.t('protocols.index.linked_children.length_menu', { number: 10 }), + I18n.t('protocols.index.linked_children.length_menu', { number: 25 }), + I18n.t('protocols.index.linked_children.length_menu', { number: 50 }) + ] + ], language: { lengthMenu: '_MENU_' }, diff --git a/app/datatables/protocol_linked_children_datatable.rb b/app/datatables/protocol_linked_children_datatable.rb index 9b3c01e10..0963befda 100644 --- a/app/datatables/protocol_linked_children_datatable.rb +++ b/app/datatables/protocol_linked_children_datatable.rb @@ -87,9 +87,9 @@ class ProtocolLinkedChildrenDatatable < CustomDatatable def filter_child_records(records) if params[:version].present? version = params[:version] - records = records.joins("LEFT JOIN protocols protocol_parents " \ - "ON protocols.parent_id = protocol_parents.id ") - .where("protocol_parents.version_number = #{version}") + records = records.joins('LEFT JOIN protocols protocol_parents ' \ + 'ON protocols.parent_id = protocol_parents.id ') + .where('protocol_parents.version_number = #{version}') end records end