mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix AlertRule relationships (#14500)
This commit is contained in:
@@ -88,6 +88,16 @@ class AlertRule extends BaseModel
|
||||
|
||||
public function devices(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\Device::class, 'alert_device_map', 'device_id', 'device_id');
|
||||
return $this->belongsToMany(\App\Models\Device::class, 'alert_device_map', 'rule_id', 'device_id');
|
||||
}
|
||||
|
||||
public function groups(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\DeviceGroup::class, 'alert_group_map', 'rule_id', 'group_id');
|
||||
}
|
||||
|
||||
public function locations(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\Location::class, 'alert_location_map', 'rule_id');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user