Validate match has only 2 scores

This commit is contained in:
Thor77 2018-11-19 14:57:55 +01:00
parent 1cd4835651
commit 552566dd2e
1 changed files with 2 additions and 0 deletions

View File

@ -4,4 +4,6 @@ class Match < ApplicationRecord
belongs_to :stage belongs_to :stage
belongs_to :group belongs_to :group
has_many :scores, dependent: :destroy has_many :scores, dependent: :destroy
validates :scores, length: { maximum: 2 }
end end