diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/pokeviewer/pokemon_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/pokeviewer/pokemon_controller.rb b/app/controllers/pokeviewer/pokemon_controller.rb index 86b0ea6..0e19c6a 100644 --- a/app/controllers/pokeviewer/pokemon_controller.rb +++ b/app/controllers/pokeviewer/pokemon_controller.rb | |||
@@ -3,12 +3,12 @@ require_dependency "pokeviewer/application_controller" | |||
3 | module Pokeviewer | 3 | module Pokeviewer |
4 | class PokemonController < ApplicationController | 4 | class PokemonController < ApplicationController |
5 | def index | 5 | def index |
6 | pokemon = Pokemon.joins(:current). | 6 | pokemon = Pokemon.order("trainer_id IS NULL DESC"). |
7 | order("trainer_id IS NULL DESC"). | ||
8 | order(trainer_id: :asc). | 7 | order(trainer_id: :asc). |
9 | order(box: :asc). | 8 | order(box: :asc). |
10 | order(slot: :asc). | 9 | order(slot: :asc). |
11 | group("pokeviewer_pokemon.uuid"). | 10 | select(:uuid).distinct. |
11 | order("pokeviewer_revisions.sequential_id DESC"). | ||
12 | includes(:current). | 12 | includes(:current). |
13 | chunk do |p| | 13 | chunk do |p| |
14 | if p.trainer_id.nil? | 14 | if p.trainer_id.nil? |