From 8caee914c6e8bd4d9635559b9197644ff12a097e Mon Sep 17 00:00:00 2001 From: Beate Quednau Date: Thu, 19 Jan 2023 13:11:21 +0100 Subject: [PATCH] Fix rubocop errors --- app/api/chemotion/search_api.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/api/chemotion/search_api.rb b/app/api/chemotion/search_api.rb index 1f563153df..2f18f74d3b 100644 --- a/app/api/chemotion/search_api.rb +++ b/app/api/chemotion/search_api.rb @@ -205,15 +205,15 @@ def serialized_result_by_id_for_sample(sample, serialized_scope) serialized = Entities::SampleEntity.represent( sample, detail_levels: detail_levels, - displayed_in_list: true + displayed_in_list: true, ).serializable_hash serialized_scope.push(serialized) end def serialized_result_by_id(element, serialized_scope) + entities = "Entities::#{id_params['model_name'].capitalize}Entity".constantize serialized = - "Entities::#{id_params['model_name'].capitalize}Entity".constantize - .represent(s, displayed_in_list: true).serializable_hash + entities.represent(element, displayed_in_list: true).serializable_hash serialized_scope.push(serialized) end @@ -529,7 +529,7 @@ def elements_by_scope(scope, collection_id = @c_id) end namespace :by_ids do - desc "Return elements by ids" + desc 'Return elements by ids' params do use :search_params end @@ -541,9 +541,10 @@ def elements_by_scope(scope, collection_id = @c_id) post do scope = search_by_ids(@c_id) return unless scope + serialize_result_by_ids( scope, - params[:page] + params[:page], ) end end