1
0
Fork 0

Display all inflections

This commit is contained in:
Alex Kotov 2023-03-25 03:17:38 +04:00
parent 7ea631ca61
commit f5deb66141
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 7 additions and 3 deletions

10
main.rb
View File

@ -176,9 +176,12 @@ public
ON parts.id = words.part_id
INNER JOIN inflections
ON inflections.part_id = parts.id
LEFT JOIN word_forms
ON word_forms.inflection_id = inflections.id
WHERE words.id = $1 AND word_forms.word_id = $1
FULL OUTER JOIN word_forms
ON
word_forms.inflection_id = inflections.id
AND
word_forms.word_id = $1
WHERE words.id = $1
ORDER BY inflections.descr
SQL
),
@ -188,6 +191,7 @@ public
result.map do |row|
descr = String(row['descr']).strip.freeze
value = String(row['value']).strip.freeze
value = nil if value.empty?
{
descr: descr,