Skip to content

Commit

Permalink
Revert "fix(13909): fixed update_at column is ambiguous-column by qua…
Browse files Browse the repository at this point in the history
…lifying column name (#26022)" (#26024)

This reverts commit 1b0c52c.
  • Loading branch information
staudenmeir authored and taylorotwell committed Oct 9, 2018
1 parent 1b0c52c commit 891ddfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
13 changes: 4 additions & 9 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,15 +822,10 @@ protected function addUpdatedAtColumn(array $values)
return $values;
}

if (! empty($this->getQuery()->joins)) {
$column = $this->model->getQualifiedUpdatedAtColumn();
} else {
$column = $this->model->getUpdatedAtColumn();
}

return array_merge($values, [
$column => $this->model->freshTimestampString(),
]);
return Arr::add(
$values, $this->model->getUpdatedAtColumn(),
$this->model->freshTimestampString()
);
}

/**
Expand Down
10 changes: 0 additions & 10 deletions src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,4 @@ public function getUpdatedAtColumn()
{
return static::UPDATED_AT;
}

/**
* Get the fully qualified "updated at" column.
*
* @return string
*/
public function getQualifiedUpdatedAtColumn()
{
return $this->getTable().'.'.$this->getUpdatedAtColumn();
}
}

0 comments on commit 891ddfc

Please sign in to comment.