diff options
Diffstat (limited to 'app/jobs')
-rw-r--r-- | app/jobs/pokeviewer/extract_save_data_job.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/jobs/pokeviewer/extract_save_data_job.rb b/app/jobs/pokeviewer/extract_save_data_job.rb index f7b8f8f..b60a8c5 100644 --- a/app/jobs/pokeviewer/extract_save_data_job.rb +++ b/app/jobs/pokeviewer/extract_save_data_job.rb | |||
@@ -22,6 +22,36 @@ module Pokeviewer | |||
22 | end | 22 | end |
23 | end | 23 | end |
24 | 24 | ||
25 | if args.key? "marineRibbon" | ||
26 | game.marine_ribbon = GiftRibbon.find_by_id(args["marineRibbon"]) | ||
27 | end | ||
28 | |||
29 | if args.key? "landRibbon" | ||
30 | game.land_ribbon = GiftRibbon.find_by_id(args["landRibbon"]) | ||
31 | end | ||
32 | |||
33 | if args.key? "skyRibbon" | ||
34 | game.sky_ribbon = GiftRibbon.find_by_id(args["skyRibbon"]) | ||
35 | end | ||
36 | |||
37 | if args.key? "countryRibbon" | ||
38 | game.country_ribbon = GiftRibbon.find_by_id(args["countryRibbon"]) | ||
39 | end | ||
40 | |||
41 | if args.key? "nationalRibbon" | ||
42 | game.national_ribbon = GiftRibbon.find_by_id(args["nationalRibbon"]) | ||
43 | end | ||
44 | |||
45 | if args.key? "earthRibbon" | ||
46 | game.earth_ribbon = GiftRibbon.find_by_id(args["earthRibbon"]) | ||
47 | end | ||
48 | |||
49 | if args.key? "worldRibbon" | ||
50 | game.world_ribbon = GiftRibbon.find_by_id(args["worldRibbon"]) | ||
51 | end | ||
52 | |||
53 | game.save! if game.changed? | ||
54 | |||
25 | args["boxes"].each_with_index do |box_name,index| | 55 | args["boxes"].each_with_index do |box_name,index| |
26 | box = Box.find_or_initialize_by(trainer: game, number: index) | 56 | box = Box.find_or_initialize_by(trainer: game, number: index) |
27 | box.name = box_name | 57 | box.name = box_name |