and again validats :attr not validte :attr

This commit is contained in:
Timothy N. Tsvetkov 2011-03-31 05:55:10 +04:00
parent e40cdbd9d3
commit 8d6d64b065
1 changed files with 2 additions and 2 deletions

View File

@ -1,8 +1,8 @@
class Project < ActiveRecord::Base class Project < ActiveRecord::Base
belongs_to :repository belongs_to :repository
validate :name, :uniqueness => true, :presence => true, :allow_nil => false, :allow_blank => false validates :name, :uniqueness => true, :presence => true, :allow_nil => false, :allow_blank => false
validate :unixname, :uniqueness => true, :presence => true, :format => { :with => /^[a-zA-Z0-9\-.]+$/ }, :allow_nil => false, :allow_blank => false validates :unixname, :uniqueness => true, :presence => true, :format => { :with => /^[a-zA-Z0-9\-.]+$/ }, :allow_nil => false, :allow_blank => false
include Project::HasRepository include Project::HasRepository