Commit d36a6e0
authored
fix: paginate word mistakes by per_page instead of a hardcoded 100 (#721)
* fix: allow navigation to the last verse (6236) from draft editors
next_ayah_translation and next_ayah_tafsir both guard with < 6235, so when
the current record is verse 6235 (the second-to-last verse) the lookup is
skipped and editors cannot advance to the final verse 6236. The sibling
proofreading view (word_text_proofreadings/show.html.erb) correctly uses
< 6236. Fix both guards to use the true total of 6236 verses.
* fix: paginate word mistakes by per_page instead of a hardcoded 100
similar_words_data computed the offset and total_pages with a hardcoded
page size of 100, but the query itself uses .limit(per_page) where
per_page is 10 by default (max 50). With the default page size, page 2
already skipped past rows 11-100, and total_pages was wrong. Compute both
from per_page so pagination matches the actual page size.1 parent 334206a commit d36a6e0
3 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
0 commit comments