Cross Reference: states.rb
xref
: /
ontohub
/
app
/
models
/
ontology_version
/
states.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
states.rb revision 5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
#
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# states:
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# * pending
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# * downloading
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# * processing
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# * failed
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
# * done
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
#
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
module
OntologyVersion
::
States
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
extend
ActiveSupport
::
Concern
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
include
StateUpdater
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
included
do
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
after_save
:
update_state_in_ontology
,
if
: :
state_changed
?
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
end
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
protected
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
def
update_state_in_ontology
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
ontology.state
=
state.to
_s
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
ontology.save
!
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
end
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
5cad3e82e8c017bc189c4cecc00541ec19a2a6e2
Julian Kornberger
end