Skip to content

Commit

Permalink
use active record for elasticsearch results. #274
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 16, 2019
1 parent 7c2c733 commit 8ed26e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/graphql/elasticsearch_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ def initialize(model)
end

def perform(ids)
@model.find_by_id(ids).results.each { |record| fulfill(record.uid, record) }
if @model.name == "Doi"
@model.find_by_id(ids).results.each { |record| fulfill(record.uid, record) }
else
@model.find_by_id(ids).records.each { |record| fulfill(record.uid, record) }
end
ids.each { |id| fulfill(id, nil) unless fulfilled?(id) }
end
end

0 comments on commit 8ed26e6

Please sign in to comment.