Skip to content

Commit 195382a

Browse files
committed
Check if timestamps are enabled for embedded models, #220
1 parent 19e9e9f commit 195382a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Jenssegers/Mongodb/Relations/EmbedsOneOrMany.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ protected function setEmbedded($data)
301301
*/
302302
protected function updateTimestamps(Model $model)
303303
{
304+
// Check if this model uses timestamps first.
305+
if ( ! $model->timestamps) return;
306+
304307
$time = $model->freshTimestamp();
305308

306309
if ( ! $model->isDirty(Model::UPDATED_AT))

0 commit comments

Comments
 (0)