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.rb1
-rw-r--r--app/models/pokeviewer/pokemon.rb3
-rw-r--r--app/views/pokeviewer/pokemon/show.html.haml2
3 files changed, 5 insertions, 1 deletions
diff --git a/app/jobs/pokeviewer/extract_save_data_job.rb b/app/jobs/pokeviewer/extract_save_data_job.rb index e4f3ae2..0a9b790 100644 --- a/app/jobs/pokeviewer/extract_save_data_job.rb +++ b/app/jobs/pokeviewer/extract_save_data_job.rb
@@ -27,6 +27,7 @@ module Pokeviewer
27 r.species_id = param["species"] 27 r.species_id = param["species"]
28 r.ot_name = param["otName"] 28 r.ot_name = param["otName"]
29 r.ot_number = param["otId"] 29 r.ot_number = param["otId"]
30 r.ot_gender = param["otGender"]
30 31
31 if param["metLevel"] == 0 32 if param["metLevel"] == 0
32 r.met_type = :hatched 33 r.met_type = :hatched
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 1410d37..1e3bfc8 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb
@@ -14,6 +14,9 @@ module Pokeviewer
14 validates :ot_number, presence: true, 14 validates :ot_number, presence: true,
15 numericality: { greater_than_or_equal_to: 0, only_integer: true } 15 numericality: { greater_than_or_equal_to: 0, only_integer: true }
16 16
17 validates :ot_gender, presence: true
18 enumerize :ot_gender, in: [:female, :male]
19
17 validates :met_level, presence: true, 20 validates :met_level, presence: true,
18 numericality: { greater_than_or_equal_to: 1, only_integer: true }, 21 numericality: { greater_than_or_equal_to: 1, only_integer: true },
19 if: Proc.new { |a| a.met_type == :normal } 22 if: Proc.new { |a| a.met_type == :normal }
diff --git a/app/views/pokeviewer/pokemon/show.html.haml b/app/views/pokeviewer/pokemon/show.html.haml index b61917c..a38d641 100644 --- a/app/views/pokeviewer/pokemon/show.html.haml +++ b/app/views/pokeviewer/pokemon/show.html.haml
@@ -6,7 +6,7 @@
6 .pokemon-name= @pokemon.revisions.last.nickname 6 .pokemon-name= @pokemon.revisions.last.nickname
7 .pokemon-ot 7 .pokemon-ot
8 OT/ 8 OT/
9 %span{ class: @pokemon.gender }>= @pokemon.ot_name 9 %span{ class: @pokemon.ot_gender }>= @pokemon.ot_name
10 .pokemon-id= "ID/#{@pokemon.ot_number}" 10 .pokemon-id= "ID/#{@pokemon.ot_number}"
11 .pokemon-level= "Lv. #{@pokemon.revisions.last.level}" 11 .pokemon-level= "Lv. #{@pokemon.revisions.last.level}"
12 %table.pokemon-ivs 12 %table.pokemon-ivs