Cross Reference: status_ontology_viewhelper.rb
xref
: /
ontohub
/
app
/
viewhelpers
/
status_ontology_viewhelper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
status_ontology_viewhelper.rb revision ecc1c5f9e6d6c3ec89fe2298ba933a82bca5bfa0
class
StatusOntologyViewhelper
STATE
=
'processing'
attr_reader
:
view
def
initialize
(
view
)
@
view
=
view
end
def
processing_ontologies_count
processing_ontology_query.size
end
def
processing_ontology_data
@
data
||=
processing_ontology_query.map
do
|
ov
|
OpenStruct.new
(
{
ontology
:
ov.ontology
,
ontology_version
:
ov
,
running_for
:
view.time
_ago_in_words
(
ov.state
_updated_at
)
,
}
)
end
end
def
any_processing_ontologies
?
processing_ontology_query.any
?
end
private
def
processing_ontology_query
OntologyVersion.where
(
state
:
STATE
)
.
order
(
'state_updated_at ASC'
)
end
end