activerecord - Validate uniqueness only on create - what am I typing wrong? Example provided -
i have code :
class member extends activerecord\model { static $validates_uniqueness_of = array( array('name', 'message' => "that name has been registered. please choose another", 'on' => 'create'), array('email', 'message' => "that email has been registered. please choose another", 'on' => 'create') ); }
the problem checks uniqueness when update. don't want that. when create.
what typing wrong?
try like
validates_uniqueness_of :name, :on => :create validates_uniqueness_of :email, :on => :create
this should trick already, give try =)
Comments
Post a Comment