Commit 57722d23 authored by Jens Segers's avatar Jens Segers

Tweak key conversion

parent 2dcb4595
......@@ -207,12 +207,11 @@ abstract class Model extends \Jenssegers\Eloquent\Model {
// Convert _id to MongoId.
if ($key == '_id' and is_string($value))
{
$this->attributes[$key] = new MongoId($value);
}
else
{
parent::setAttribute($key, $value);
$builder = $this->newBaseQueryBuilder();
$value = $builder->convertKey($value);
}
parent::setAttribute($key, $value);
}
/**
......
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