Model validation rule (checkUnique method got from tempdocs :-) ):
=====
var $validate = array(
'name' => array(
'on'=>'create',
'rule' => array('checkUnique'),
'message' => 'Name is not unique!',
'allowEmpty' => false,
),
=====
$Model->data
========
data[Model][id]=3;
data[Model][name]='A name';
========
When I call Model->validates() in my controller, it fails (name isn't
unique), but Model->save() works fine.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---