about summary refs log tree commit diff stats
path: root/app/models/pokeviewer/move.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/pokeviewer/move.rb')
-rw-r--r--app/models/pokeviewer/move.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/pokeviewer/move.rb b/app/models/pokeviewer/move.rb index 3ef6a9c..c63493a 100644 --- a/app/models/pokeviewer/move.rb +++ b/app/models/pokeviewer/move.rb
@@ -10,10 +10,12 @@ module Pokeviewer
10 validates :pp, presence: true, 10 validates :pp, presence: true,
11 numericality: { greater_than_or_equal_to: 1, only_integer: true } 11 numericality: { greater_than_or_equal_to: 1, only_integer: true }
12 12
13 validates :move_type, presence: true 13 TYPES = [:normal, :fighting, :flying, :poison, :ground,
14 enumerize :move_type, in: [:normal, :fighting, :flying, :poison, :ground,
15 :rock, :bug, :ghost, :steel, :mystery, :fire, :water, :grass, :electric, 14 :rock, :bug, :ghost, :steel, :mystery, :fire, :water, :grass, :electric,
16 :psychic, :ice, :dragon, :dark], predicates: true 15 :psychic, :ice, :dragon, :dark]
16
17 validates :move_type, presence: true
18 enumerize :move_type, in: TYPES, predicates: true
17 19
18 validates :rs_description, presence: true 20 validates :rs_description, presence: true
19 validates :frlg_description, presence: true 21 validates :frlg_description, presence: true