Skip to content

Commit

Permalink
inserted apostrophes to fix string column conditions (e.g. WHERE stat…
Browse files Browse the repository at this point in the history
…us = 'active')
  • Loading branch information
cgernert committed May 18, 2016
1 parent 3a25e90 commit f03845b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function saveAll($skippedRelations = [])
$isManyMany = count($relModel->primaryKey()) > 1;
if($isManyMany){
foreach ($rel['link'] as $k => $v) {
$condition[] = $k . " = " . $this->$v;
$condition[] = "$k = '{$this->$v}'";
}
try {
$relModel->deleteAll(implode(" AND ", $condition));
Expand All @@ -206,7 +206,7 @@ public function saveAll($skippedRelations = [])
}else{
if($rel['ismultiple']){
foreach ($rel['link'] as $k => $v) {
$condition[] = $k . " = " . $this->$v;
$condition[] = "$k = '{$this->$v}'";
}
try {
$relModel->deleteAll(implode(" AND ", $condition));
Expand Down

0 comments on commit f03845b

Please sign in to comment.