mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Model validations
This commit is contained in:
@@ -2,6 +2,8 @@ class Mat < ActiveRecord::Base
|
||||
belongs_to :tournament
|
||||
has_many :matches
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
before_destroy do
|
||||
if tournament.matches.size > 0
|
||||
tournament.resetMats
|
||||
|
||||
Reference in New Issue
Block a user