diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/pokeviewer/pokemon_controller.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/pokeviewer/pokemon_controller.rb b/app/controllers/pokeviewer/pokemon_controller.rb index 49a743c..7a1b9f9 100644 --- a/app/controllers/pokeviewer/pokemon_controller.rb +++ b/app/controllers/pokeviewer/pokemon_controller.rb | |||
@@ -10,9 +10,7 @@ module Pokeviewer | |||
10 | order(slot: :asc). | 10 | order(slot: :asc). |
11 | order("pokeviewer_revisions.sequential_id DESC"). | 11 | order("pokeviewer_revisions.sequential_id DESC"). |
12 | group("pokeviewer_pokemon.uuid"). | 12 | group("pokeviewer_pokemon.uuid"). |
13 | select(:box, :slot, :uuid, :trainer_id, :species_id). | 13 | includes(:revisions). |
14 | select(:ot_gender, :ot_name, :unown_letter). | ||
15 | select("pokeviewer_revisions.nickname AS nickname"). | ||
16 | chunk do |p| | 14 | chunk do |p| |
17 | if p.trainer_id.nil? | 15 | if p.trainer_id.nil? |
18 | -1 | 16 | -1 |
@@ -71,8 +69,8 @@ module Pokeviewer | |||
71 | 69 | ||
72 | def show | 70 | def show |
73 | @pokemon = Pokemon.includes( | 71 | @pokemon = Pokemon.includes( |
74 | :trainer, :species, :location, | 72 | :trainer, :location, |
75 | revisions: [:item, :move_1, :move_2, :move_3, :move_4] | 73 | revisions: [:species, :item, :move_1, :move_2, :move_3, :move_4] |
76 | ).find_by_uuid! params[:id] | 74 | ).find_by_uuid! params[:id] |
77 | end | 75 | end |
78 | end | 76 | end |