Allow higher amount of points for matches... ask Mega why this is needed

This commit is contained in:
Absurdon 2018-02-12 00:15:38 +01:00
parent 3e42e2d205
commit 8a29678907
2 changed files with 3 additions and 3 deletions

View file

@ -118,7 +118,7 @@ class Match < ActiveRecord::Base
order: "month_n"
validates :contester1, :contester2, :contest, presence: true
validates :score1, :score2, format: /\A[0-9]\z/, allow_nil: true
validates :score1, :score2, format: /\A[1-9]?[0-9]\z/, allow_nil: true
validates :report, length: { maximum: 64_000 }, allow_blank: true
before_create :set_hltv

View file

@ -18,8 +18,8 @@ class Prediction < ActiveRecord::Base
attr_protected :id, :created_at, :updated_at, :result
validates_presence_of :match, :user
validates_inclusion_of :score1, :in => 0..4, :message => "Invalid score"
validates_inclusion_of :score2, :in => 0..4, :message => "Invalid score"
validates_inclusion_of :score1, :in => 0..99, :message => "Invalid score"
validates_inclusion_of :score2, :in => 0..99, :message => "Invalid score"
validates_uniqueness_of :match_id, :scope => :user_id
scope :with_contest, :include => {:match => :contest}