toopay/gas-orm — Issue #14: Check unique fields with updates
Author: shinkevich
Created: 2012-01-17 12:08:37+00:00
State: open

I created table "brands":
- id
- url
- ...

And wrote in model:
class Brand{
function _init(){
...
$this->_unique_fields(array('url'));
}
}

When I add new record with "insert" with dublicate "url" field I give ..->errors(), but when I update existing record ..->errors() consist empty array but ..->save(true) === 0