Commit edb167a
committed
fix: adjust into to model 4 show custom order
1. Adicionado scope ordered_by_role no model Player (app/models/player.rb:41-52)
- Usa CASE WHEN do SQL para ordenar na sequência correta: top → jungle → mid → adc → support
2. Atualizado PlayersController (app/controllers/api/v1/players_controller.rb:18)
- Substituiu .order(:role, :summoner_name) por .ordered_by_role.order(:summoner_name)
- Agora ordena primeiro por posição (na ordem correta) e depois pelo nome do jogador
3. Atualizado DashboardController (app/controllers/api/v1/dashboard_controller.rb:113)
- O by_role agora também respeita a ordem correta das posições1 parent 8892c96 commit edb167a
3 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
0 commit comments