diff --git a/extensions/mongo/ActiveRecord.php b/extensions/mongo/ActiveRecord.php index b0a360e..86aa6d1 100644 --- a/extensions/mongo/ActiveRecord.php +++ b/extensions/mongo/ActiveRecord.php @@ -348,6 +348,6 @@ abstract class ActiveRecord extends BaseActiveRecord if ($this->isNewRecord || $record->isNewRecord) { return false; } - return $this->collectionName() === $record->collectionName() && $this->getPrimaryKey() === $record->getPrimaryKey(); + return $this->collectionName() === $record->collectionName() && (string)$this->getPrimaryKey() === (string)$record->getPrimaryKey(); } } \ No newline at end of file