From 5ade37d852bd1e96f9451ab98619359a5a048cee Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 29 Jan 2018 21:13:35 -0500 Subject: Added Pokédex viewing page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently a work in progress. The queries used to display the Pokémon for each species are very inefficient. The text at the top of the page is also very specific to the author. --- app/jobs/pokeviewer/extract_save_data_job.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/jobs') diff --git a/app/jobs/pokeviewer/extract_save_data_job.rb b/app/jobs/pokeviewer/extract_save_data_job.rb index b0999ef..bb18d68 100644 --- a/app/jobs/pokeviewer/extract_save_data_job.rb +++ b/app/jobs/pokeviewer/extract_save_data_job.rb @@ -173,6 +173,16 @@ module Pokeviewer rev.save! end end + + game.pokedex_entries.clear + + args["seen"].each do |param| + game.pokedex_entries.create(species_id: param, caught: false) + end + + args["caught"].each do |param| + game.pokedex_entries.create(species_id: param, caught: true) + end end end end -- cgit 1.4.1