Return other word ID
This commit is contained in:
parent
d1c32bc575
commit
2ef60bc035
8
main.rb
8
main.rb
|
@ -170,7 +170,7 @@ public
|
|||
result = @db_conn.exec_params(
|
||||
(
|
||||
<<~SQL
|
||||
SELECT inflections.descr, word_forms.value
|
||||
SELECT inflections.descr, word_forms.value, word_forms.other_word_id
|
||||
FROM words
|
||||
INNER JOIN parts
|
||||
ON parts.id = words.part_id
|
||||
|
@ -190,12 +190,18 @@ public
|
|||
|
||||
result.map do |row|
|
||||
descr = String(row['descr']).strip.freeze
|
||||
|
||||
value = String(row['value']).strip.freeze
|
||||
value = nil if value.empty?
|
||||
|
||||
unless row['other_word_id'].nil?
|
||||
other_word_id = Integer(row['other_word_id'])
|
||||
end
|
||||
|
||||
{
|
||||
descr: descr,
|
||||
value: value,
|
||||
other_word_id: other_word_id,
|
||||
}
|
||||
end.freeze
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue