diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/pokeviewer/pokemon.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 1e3bfc8..3975550 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb | |||
@@ -36,6 +36,10 @@ module Pokeviewer | |||
36 | enumerize :unown_letter, in: [:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, | 36 | enumerize :unown_letter, in: [:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, |
37 | :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z, | 37 | :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z, |
38 | :question, :exclamation] | 38 | :question, :exclamation] |
39 | |||
40 | validates :slot, presence: true, | ||
41 | uniqueness: { scope: [:trainer_id, :box] }, | ||
42 | unless: Proc.new { |a| a.trainer.nil? } | ||
39 | 43 | ||
40 | def to_param | 44 | def to_param |
41 | uuid | 45 | uuid |