Update Report model

pull/547/head
Daniel Supernault 8 years ago
parent 7492194cc2
commit 9f29ab9338
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -22,14 +22,15 @@ class Report extends Model
{ {
$class = $this->object_type; $class = $this->object_type;
switch ($class) { switch ($class) {
case 'App\Status': case 'App\Status':
$column = 'id'; $column = 'id';
break; break;
default: default:
$column = 'id'; $class = 'App\Status';
break; $column = 'id';
} break;
}
return (new $class())->where($column, $this->object_id)->firstOrFail(); return (new $class())->where($column, $this->object_id)->firstOrFail();
} }

Loading…
Cancel
Save