Cross Reference: theorem.rb
xref
: /
ontohub
/
app
/
models
/
theorem.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
theorem.rb revision e200ddd4b78a4915a072095be2a2e6cac65ed333
class
Theorem
<
Sentence
DEFAULT_STATUS
=
'OPN'
has_many
:
proof_attempts
,
foreign_key
:
'sentence_id'
belongs_to
:
proof_status
# Override Sentence's type: nil scope.
# Results in duplicate condition in the sql statement.
default_scope
where
(
type
: [
'Theorem'
])
before_save
:
set_default_proof_status
def
set_default_proof_status
self.proof
_status
=
ProofStatus.find
(
DEFAULT_STATUS
)
unless
proof_status
end
def
update_proof_status
(
proof_status
)
if
proof_status.decisive
? || !
self.proof_status.decisive
?
self.proof
_status
=
proof_status
save
end
end
end