From 2447a8aa433993f254651e1da44350a5fe44adaf Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Wed, 26 Feb 2025 20:29:00 -0800 Subject: [PATCH] Handle upcoming API change for publication attribute Wrap `sub.publication` in `Array().last` to ensure compatibility with the upcoming API update. UI redesign needed for full support. --- app/views/layouts/_ontology_viewer.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_ontology_viewer.html.haml b/app/views/layouts/_ontology_viewer.html.haml index be601848f..f1f09f60d 100644 --- a/app/views/layouts/_ontology_viewer.html.haml +++ b/app/views/layouts/_ontology_viewer.html.haml @@ -95,8 +95,8 @@ = link_to(sub.documentation, class: 'btn btn-outline-secondary', "aria-label": "Documentation", title: "Documentation", target: "_blank") do %i.fas.fa-lg.fa-book-reader{"aria-hidden": true} - - unless sub.publication.nil? - = link_to(sub.publication, class: 'btn btn-outline-secondary', "aria-label": "Publications", + - unless Array(sub.publication).last.nil? + = link_to(Array(sub.publication).last, class: 'btn btn-outline-secondary', "aria-label": "Publications", title: "Publications", target: "_blank") do %i.far.fa-lg.fa-newspaper{"aria-hidden": true} - if @ontology.admin?(session[:user])