Skip to content

Commit

Permalink
proper event for transition from registered to findable
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 11, 2019
1 parent cefe19e commit 956330c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 956330c

Please sign in to comment.