UnionOfRAD/lithium — pull request #1077 by liugf (2014-04-01 05:34:09+00:00)
Title: Update Validator.php

if the field is not required, and the value is empty, should return true.

···
public $validates = array(
'name' => array('notEmpty', 'message' => 'name must not be empty'),
'project_id' => array(
array('notEmpty', 'message' => 'project_id must not be empty'),
array('decimal', 'message' => 'project_id must be decimal'),
),
'deadline' => array('date', 'required' => false, 'format' => 'ymd', 'message' => 'deadline must be date fomat'),
);

···

when i find the model from database, the deadline attributes is null, then save it, it throw a validation error.