Reduce complexity of IndexComposer

This commit is contained in:
James Brooks
2015-01-14 16:19:11 +00:00
parent e247a47795
commit e5a14696bd

View File

@@ -23,9 +23,7 @@ class IndexComposer
'systemMessage' => trans('cachet.service.bad'),
];
$components = Component::notStatus(1);
if (Component::all()->count() === 0 || $components->count() === 0) {
if (Component::notStatus(1)->count() === 0) {
// If all our components are ok, do we have any non-fixed incidents?
$incidents = Incident::orderBy('created_at', 'desc')->get();
$incidentCount = $incidents->count();