From 8a296789075a52d8ae89734616690ca5f0a3fcc7 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Mon, 12 Feb 2018 00:15:38 +0100 Subject: [PATCH] Allow higher amount of points for matches... ask Mega why this is needed --- app/models/match.rb | 2 +- app/models/prediction.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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}