From 956330cccaf3f7281dda1378ebe68e3bf1a80d09 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 11 Jun 2019 16:22:19 +0200 Subject: [PATCH] proper event for transition from registered to findable --- app/models/doi.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index d4b6fd3f0..06dcd6a2e 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -45,6 +45,10 @@ class Doi < ActiveRecord::Base transitions from: [:findable], to: :registered end + event :show do + transitions from: [:registered], to: :findable + end + event :flag do transitions from: [:registered, :findable], to: :flagged end @@ -584,7 +588,7 @@ def cache_key end def event=(value) - self.send(value) if %w(register publish hide).include?(value) + self.send(value) if %w(register publish hide show).include?(value) end # delete all DOIs with test prefix 10.5072 not updated since from_date