Lines Matching refs:resource
2 def erroneous_with_message?(resource)
3 resource.respond_to?(:last_error) &&
4 resource.state == 'failed' &&
5 resource.last_error
8 def error_message(resource)
9 resource.last_error
12 def retry_resource_chain(resource)
13 if resource.is_a?(Ontology)
14 url_for([resource, :retry])
15 elsif resource.is_a?(Theorem)
16 [:retry_failed, *resource_chain, resource]
17 elsif resource.is_a?(ProofAttempt)
18 [:retry_failed, *resource_chain, resource.theorem, resource]
24 def retriable?(resource)
25 resource.respond_to?(:retry_failed) ||
26 resource.class.respond_to?(:retry_failed)
29 def state_tag(resource)
30 resource = resource.is_a?(Ontology) ? resource.current_version : resource
34 "evaluation-state label #{State::STATE_LABEL[resource.state.to_sym]}",
36 klass: resource.class.to_s,
37 id: resource.id,
38 uri: url_for(resource),
39 state: resource.state,
43 state(resource)
47 def state(resource)
48 html = content_tag(:span, t("states.#{resource.state}"))
50 unless State::IDLE_STATES.include?(resource.state)
54 if resource.state == 'failed' && resource.is_a?(Ontology)
55 version = resource.versions.last
59 url_for([resource, :ontology_versions]),