Return inflection ID
This commit is contained in:
parent
702dadfa00
commit
084222667a
1 changed files with 9 additions and 3 deletions
12
main.rb
12
main.rb
|
@ -180,7 +180,11 @@ public
|
|||
result = @db_conn.exec_params(
|
||||
(
|
||||
<<~SQL
|
||||
SELECT inflections.descr, word_forms.value, word_forms.other_word_id
|
||||
SELECT
|
||||
inflections.id,
|
||||
inflections.descr,
|
||||
word_forms.value,
|
||||
word_forms.other_word_id
|
||||
FROM words
|
||||
INNER JOIN parts
|
||||
ON parts.id = words.part_id
|
||||
|
@ -199,7 +203,8 @@ public
|
|||
).to_a
|
||||
|
||||
result.map do |row|
|
||||
descr = String(row['descr']).strip.freeze
|
||||
inflection_id = Integer row['id']
|
||||
inflection_descr = String(row['descr']).strip.freeze
|
||||
|
||||
value = String(row['value']).strip.freeze
|
||||
value = nil if value.empty?
|
||||
|
@ -209,7 +214,8 @@ public
|
|||
end
|
||||
|
||||
{
|
||||
descr: descr,
|
||||
inflection_id: inflection_id,
|
||||
inflection_descr: inflection_descr,
|
||||
value: value,
|
||||
other_word_id: other_word_id,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue