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