Order and numerate
This commit is contained in:
parent
00983f0a6c
commit
e4771aa226
4
main.rb
4
main.rb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue