Merge pull request #41 from Kilte/fix-has-rule

Fixed hasRule() method.
This commit is contained in:
Vance Lucas 2014-01-07 20:55:02 -08:00
commit 9d51c509c4

View File

@ -589,10 +589,13 @@ class Validator
*/
protected function hasRule($name, $field)
{
foreach($this->_validations as $validation) {
if ($validation['rule'] == $name)
return in_array($field, $validation['fields']);
}
foreach($this->_validations as $validation) {
if ($validation['rule'] == $name) {
if (in_array($field, $validation['fields'])) {
return true;
}
}
}
return false;
}