again validateS :attr, not validate :attr

This commit is contained in:
Timothy N. Tsvetkov 2011-03-31 05:00:40 +04:00
parent 5df5e53f46
commit 4f249b209a
1 changed files with 2 additions and 2 deletions

View File

@ -2,8 +2,8 @@ class Repository < ActiveRecord::Base
belongs_to :platform belongs_to :platform
has_many :projects, :dependent => :destroy has_many :projects, :dependent => :destroy
validate :name, :presence => true, :uniqueness => true validates :name, :presence => true, :uniqueness => true
validate :unixname, :uniqueness => true, :presence => true, :format => { :with => /^[a-zA-Z0-9\-.]+$/ } validates :unixname, :uniqueness => true, :presence => true, :format => { :with => /^[a-zA-Z0-9\-.]+$/ }
scope :recent, order("name ASC") scope :recent, order("name ASC")