Skip to content

Commit

Permalink
Fix rubocop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
beque committed Jan 19, 2023
1 parent 63816f2 commit 8caee91
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/api/chemotion/search_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8caee91

Please sign in to comment.