Skip to content

Commit

Permalink
remove batchloader from controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Jul 15, 2019
1 parent cea186a commit ca90901
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,7 @@ def index

if @include.include? :dois
doi_names = (results.map { |event| event.doi}).join(",")
events_serialized[:included] = if params["batchload"] == "true" || params["batchload"].nil?
logger.info "batchload"
DoiSerializer.new(load_doi(doi_names), {is_collection: true}).serializable_hash.dig(:data)
elsif params["batchload"] == "false"
logger.info "find_by_doi"
Doi.find_by_id(doi_names).results
end
events_serialized[:included] = DoiSerializer.new(Doi.find_by_id(doi_names).results, {is_collection: true}).serializable_hash.dig(:data)
end

render json: events_serialized, status: :ok
Expand Down

0 comments on commit ca90901

Please sign in to comment.