1
0
Fork 0

Order and numerate

This commit is contained in:
Alex Kotov 2023-02-18 18:14:42 +04:00
parent 00983f0a6c
commit e4771aa226
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 3 additions and 1 deletions

View File

@ -134,13 +134,15 @@ public
word_id = $1
AND
translation_texts.lang_id = $2
ORDER BY translations.index ASC
SQL
),
[word_id, user_lang_id],
).to_a
values.map do |row|
values.map.with_index do |row, index|
{
index: index + 1,
translation: String(row['value']).strip.freeze,
commentary: String(row['commentary']).strip.freeze,
}.freeze