From 012b083cbd74ab687d5529258ff045319265e594 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 24 Sep 2017 12:39:17 -0400 Subject: Added storage location information to Pokémon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/pokeviewer/pokemon.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models') 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 enumerize :unown_letter, in: [:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z, :question, :exclamation] + + validates :slot, presence: true, + uniqueness: { scope: [:trainer_id, :box] }, + unless: Proc.new { |a| a.trainer.nil? } def to_param uuid -- cgit 1.4.1