Skip to content

Commit

Permalink
update DOIs with missing state. datacite/datacite#491
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Sep 25, 2018
1 parent c6655e3 commit a4c43e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit a4c43e6

Please sign in to comment.