1
0
Fork 0

Return other word ID

This commit is contained in:
Alex Kotov 2023-03-25 04:07:32 +04:00
parent d1c32bc575
commit 2ef60bc035
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 7 additions and 1 deletions

View File

@ -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