Commit b9cc872a authored by Stas's avatar Stas Committed by Jens Segers

Revert changes in Builder and Model for id keys, fix test for Queue (#1795)

* Revert changes in Builder and Model for id keys, fix test for Queue

* Fix format in Model
parent 4ef3483e
......@@ -32,7 +32,7 @@ abstract class Model extends BaseModel
* @var string
*/
protected $primaryKey = '_id';
/**
* The primary key type.
*
......@@ -175,7 +175,7 @@ abstract class Model extends BaseModel
public function setAttribute($key, $value)
{
// Convert _id to ObjectID.
if (($key == '_id' || Str::endsWith($key, '_id')) && is_string($value)) {
if ($key == '_id' && is_string($value)) {
$builder = $this->newBaseQueryBuilder();
$value = $builder->convertKey($value);
......
......@@ -906,7 +906,7 @@ class Builder extends BaseBuilder
}
// Convert id's.
if (isset($where['column']) && ($where['column'] == '_id' || Str::endsWith($where['column'], '_id'))) {
if (isset($where['column']) && ($where['column'] == '_id' || Str::endsWith($where['column'], '._id'))) {
// Multiple values.
if (isset($where['values'])) {
foreach ($where['values'] as &$value) {
......
......@@ -24,6 +24,7 @@ class QueueTest extends TestCase
'displayName' => 'test',
'job' => 'test',
'maxTries' => null,
'delay' => null,
'timeout' => null,
'data' => ['action' => 'QueueJobLifeCycle'],
]), $job->getRawBody());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment