Commit 1be274ca authored by Jesse O'Brien's avatar Jesse O'Brien

Change update function so it uses timestamp like save

Calling update() on an eloquent model has no way of overriding
the timestamp that should be set if $timestamps is set on the
model. This changes that so it uses the timestamp() function
which is an easy way to over ride the type of timestamps used.
parent 3ba5c00e
......@@ -218,9 +218,11 @@ abstract class Model {
{
$model = new static(array(), true);
if (static::$timestamps) $attributes['updated_at'] = new \DateTime;
$model->fill($attributes);
return $model->query()->where($model->key(), '=', $id)->update($attributes);
if (static::$timestamps) $model->timestamp();
return $model->query()->where($model->key(), '=', $id)->update($model->attributes);
}
/**
......
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