From a4c43e6f752e7fc6fef18b968ddff642064bea10 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 25 Sep 2018 09:07:17 +0200 Subject: [PATCH] update DOIs with missing state. datacite/datacite#491 --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index bc4dd3f46..356dacada 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -430,7 +430,7 @@ def timestamp # update state for all DOIs in state "undetermined" starting from from_date def self.set_state(from_date: nil) from_date ||= Time.zone.now - 1.day - Doi.where("updated >= ?", from_date).where(aasm_state: 'undetermined').find_each do |doi| + Doi.where("updated >= ?", from_date).where(aasm_state: '').find_each do |doi| if doi.is_test_prefix? || (doi.is_active == "\x00" && doi.minted.blank?) state = "draft" elsif doi.is_active == "\x00" && doi.minted.present?