cleaning up validator method.

This commit is contained in:
Taylor Otwell 2012-02-14 16:53:08 -06:00
parent e1c8928550
commit 75280a9fea
1 changed files with 4 additions and 1 deletions

View File

@ -459,7 +459,10 @@ protected function validate_unique($attribute, $value, $parameters)
// We allow the table column to be specified just in case the column does // We allow the table column to be specified just in case the column does
// not have the same name as the attribute. It must be within the second // not have the same name as the attribute. It must be within the second
// parameter position, right after the database table name. // parameter position, right after the database table name.
if (isset($parameters[1])) $attribute = $parameters[1]; if (isset($parameters[1]))
{
$attribute = $parameters[1];
}
$query = $this->db()->table($parameters[0])->where($attribute, '=', $value); $query = $this->db()->table($parameters[0])->where($attribute, '=', $value);