Cross Reference: oops_requests.rb
xref
: /
ontohub
/
app
/
models
/
ontology_version
/
oops_requests.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
module
OntologyVersion
::
OopsRequests
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
extend
ActiveSupport
::
Concern
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
included
do
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
has_one
:
request
,
class_name
:
'OopsRequest'
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
end
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
def
oops_request_creatable
?
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
request.nil
? ||
request.state
==
'failed'
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
end
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
def
create_oops_request
!
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
raise
"request is pending"
unless
oops_request_creatable
?
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
request.try
(:
destroy
)
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
build_request.save
!
dda6f544eb58d850394073e34ae6127498869a77
Christian Clausen
end
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
ee5342a8882c2fc7631fcffb5497e6597747887c
Tim Reddehase
end