Cross Reference: translated_sentence.rb
xref
: /
ontohub
/
app
/
models
/
translated_sentence.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
translated_sentence.rb revision 98b33b983ff8b06e741abbc9f0d2fb10fb658147
class
TranslatedSentence
<
ActiveRecord
::
Base
belongs_to
:
ontology
belongs_to
:
audience
,
class_name
:
Ontology.to
_s
belongs_to
:
sentence
belongs_to
:
symbol_mapping
attr_accessible
:
audience
, :
ontology
, :
sentence
, :
symbol_mapping
attr_accessible
:
translated_text
delegate
:
name
, :
locid
,
to
: :
sentence
def
text
translated_text
end
def
display_text
?
false
end
# returns a translated sentence if
# an applicable one could be found
def
self.choose
_applicable
(
sentence
,
mapping
)
source
=
mapping.mapping.source
where
(
audience_id
:
source
,
sentence_id
:
sentence
)
.
first
||
sentence
end
end