about summary refs log tree commit diff stats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/jobs/pokeviewer/extract_save_data_job.rb4
-rw-r--r--app/models/pokeviewer/pokemon.rb5
2 files changed, 7 insertions, 2 deletions
diff --git a/app/jobs/pokeviewer/extract_save_data_job.rb b/app/jobs/pokeviewer/extract_save_data_job.rb index 14ba9a6..f94ce74 100644 --- a/app/jobs/pokeviewer/extract_save_data_job.rb +++ b/app/jobs/pokeviewer/extract_save_data_job.rb
@@ -76,7 +76,9 @@ module Pokeviewer
76 r.ot_number = param["otId"] 76 r.ot_number = param["otId"]
77 r.ot_gender = param["otGender"] 77 r.ot_gender = param["otGender"]
78 78
79 if param["metLevel"] == 0 79 if param["orre"]
80 r.met_type = :orre
81 elsif param["metLevel"] == 0
80 r.met_type = :hatched 82 r.met_type = :hatched
81 r.location_id = param["metLocation"] 83 r.location_id = param["metLocation"]
82 elsif param["metLocation"] == 254 84 elsif param["metLocation"] == 254
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 3818f58..18d1533 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb
@@ -49,7 +49,8 @@ module Pokeviewer
49 if: Proc.new { |a| a.met_type == :normal } 49 if: Proc.new { |a| a.met_type == :normal }
50 50
51 validates :met_type, presence: true 51 validates :met_type, presence: true
52 enumerize :met_type, in: [:normal, :hatched, :npc_trade, :fateful_encounter] 52 enumerize :met_type,
53 in: [:normal, :hatched, :npc_trade, :fateful_encounter, :orre]
53 54
54 belongs_to :location, optional: true 55 belongs_to :location, optional: true
55 validates :location, presence: true, 56 validates :location, presence: true,
@@ -153,6 +154,8 @@ module Pokeviewer
153 "Met in a trade." 154 "Met in a trade."
154 elsif met_type == :fateful_encounter 155 elsif met_type == :fateful_encounter
155 "Obtained in a fateful encounter at Lv. #{met_level}." 156 "Obtained in a fateful encounter at Lv. #{met_level}."
157 elsif met_type == :orre
158 "Met in a trade."
156 end 159 end
157 end 160 end
158 161