I have this code :
class Member extends ActiveRecord\Model
{
static $validates_uniqueness_of = array(
array('name', 'message' => "That name has already been registered. Please choose another", 'on' => 'create'),
array('email', 'message' => "That email has already been registered. Please choose another", 'on' => 'create')
);
}
The problem is that it checks uniqueness when I update. I don't want that. Only when I create.
What am I typing wrong?
hmm, that should work according to the manual, but if it doesn't your best try might be the custom validat function, as explained in that link:
Another option would be to update using the
save(false)
call, so you skip the validation. Is a bit tricky as well.