From 9070a46ea689afb05c7fd1e601ac5a7c4307fb2e Mon Sep 17 00:00:00 2001 From: tibvdm Date: Tue, 16 Apr 2024 13:10:02 +0200 Subject: [PATCH] fix equate IL --- app/controllers/private_api/proteins_controller.rb | 9 ++++++--- app/views/private_api/proteins/proteins.json.jbuilder | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/private_api/proteins_controller.rb b/app/controllers/private_api/proteins_controller.rb index 56b8f2e..110b259 100644 --- a/app/controllers/private_api/proteins_controller.rb +++ b/app/controllers/private_api/proteins_controller.rb @@ -32,9 +32,12 @@ def proteins @proteins = UniprotEntry .includes(:taxon) .where(uniprot_accession_number: search_result["uniprot_accessions"]) - .map do |protein| - protein[:test] = protein.fa.split(";") - protein + .map do |protein| { + uniprot_accession_number: protein.uniprot_accession_number, + name: protein.name, + organism: protein.taxon_id + test: protein.fa.split(";") + } end diff --git a/app/views/private_api/proteins/proteins.json.jbuilder b/app/views/private_api/proteins/proteins.json.jbuilder index ffb2139..dcbb2dc 100644 --- a/app/views/private_api/proteins/proteins.json.jbuilder +++ b/app/views/private_api/proteins/proteins.json.jbuilder @@ -15,4 +15,5 @@ json.proteins @proteins do |protein| json.uniprotAccessionId protein.uniprot_accession_number json.name protein.name json.organism protein.taxon_id + json.test protein.test end