From 8111a3263a917b0f95e997557793686d399d5b8b Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 2 Feb 2020 10:46:28 +0100 Subject: [PATCH] fix syntax. #388 --- app/models/event.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index a2315308f..a258dafc3 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -358,7 +358,7 @@ def self.update_crossref(options = {}) if response.results.total > 0 while response.results.results.length > 0 do response = Event.query(nil, source_id: "crossref", page: { size: size, cursor: cursor }) - break unless response.results.results.length > 0 + break unless response.results.results.length.positive? Rails.logger.info "[Update] Updating #{response.results.results.length} crossref events starting with _id #{response.results.to_a.first[:_id]}." cursor = response.results.to_a.last[:sort] @@ -382,7 +382,7 @@ def self.update_target_doi(options = {}) if response.results.total > 0 while response.results.results.length > 0 do response = Event.query(nil, target_doi: nil, page: { size: size, cursor: cursor }) - break unless response.results.results.positive? + break unless response.results.results.length.positive? Rails.logger.info "[Update] Updating #{response.results.results.length} events with no target_doi starting with _id #{response.results.to_a.first[:_id]}." cursor = response.results.to_a.last[:sort]