From 431b4541c38f1d47f3f8d196f2f02ea94cb8ad32 Mon Sep 17 00:00:00 2001 From: nwb Date: Mon, 7 Jul 2014 14:37:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=AB=9E=E8=B5=9B=E6=97=B6?= =?UTF-8?q?=E5=A5=96=E5=8A=B1=E8=AE=BE=E7=BD=AE=E4=B8=BA=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/contest.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/contest.rb b/app/models/contest.rb index d41506b8..7f6e10a8 100644 --- a/app/models/contest.rb +++ b/app/models/contest.rb @@ -24,7 +24,7 @@ class Contest < ActiveRecord::Base validates_length_of :name, :maximum => NAME_LENGTH_LIMIT validates_length_of :description, :maximum => DESCRIPTION_LENGTH_LIMIT - validates_presence_of :author_id, :name, :deadline + validates_presence_of :author_id, :name, :deadline,:budget validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/ # validates_format_of :budget, :with => /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/ validate :validate_user