Skip to content

Commit

Permalink
Fix postgresql create on call is_unique via API
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 2, 2020
1 parent 7edf31b commit 388cde2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion system/Validation/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ public function is_unique(string $str = null, string $field, array $data): bool

if (! empty($ignoreField) && ! empty($ignoreValue))
{
$row = $row->where("{$ignoreField} !=", $ignoreValue);
preg_match('/(?:{)(.*)(?:})/', $ignoreValue, $matches);
if (! $matches)
{
$row = $row->where("{$ignoreField} !=", $ignoreValue);
}
}

return (bool) ($row->get()
Expand Down

0 comments on commit 388cde2

Please sign in to comment.