diff --git a/app/models/match.rb b/app/models/match.rb index 0772406..2346c07 100755 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -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 diff --git a/app/models/prediction.rb b/app/models/prediction.rb index f8aeea4..8153665 100644 --- a/app/models/prediction.rb +++ b/app/models/prediction.rb @@ -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}