Cross Reference: states.rb
xref
: /
ontohub
/
app
/
models
/
ontology
/
states.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
module
Ontology
::
States
extend
ActiveSupport
::
Concern
STATES
=
State
::
STATES
included
do
STATES.each
do
|
state
|
eval
"def #{state}?; state == '#{state}'; end"
end
end
module
ClassMethods
# Enqueues new parse jobs for all failed ontologies
def
retry_failed
state
(:
failed
)
.without_parent.find
_each
do
|
ontology
|
OntologySaver.new
(
ontology.repository
)
.
async_parse_version
(
ontology.current
_version
)
end
end
def
count_by_state
select
(
"state, count(*) AS count"
)
.
group
(:
state
)
end
end
def
changeable
?
done
?
or
failed
?
end
end