From 5a2403e6d2dd96383b5cfeef57292a71c7e18e70 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 20 Jun 2019 11:35:58 -0500 Subject: [PATCH] Fix saving new device groups (#10356) We need a device group id --- app/Models/DeviceGroup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/DeviceGroup.php b/app/Models/DeviceGroup.php index a758ceec6e..3a30da98fd 100644 --- a/app/Models/DeviceGroup.php +++ b/app/Models/DeviceGroup.php @@ -46,6 +46,11 @@ class DeviceGroup extends BaseModel static::saving(function (DeviceGroup $deviceGroup) { if ($deviceGroup->isDirty('rules')) { $deviceGroup->rules = $deviceGroup->getParser()->generateJoins()->toArray(); + } + }); + + static::saved(function (DeviceGroup $deviceGroup) { + if ($deviceGroup->isDirty('rules')) { $deviceGroup->updateDevices(); } });