Fix hound [SCI-8007]

This commit is contained in:
sboursen-scinote 2023-03-09 22:13:52 +01:00
parent 506c750eee
commit 36782611b4
2 changed files with 11 additions and 4 deletions

View file

@ -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_'
},

View file

@ -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