Fixes all assets showing as unassigned in license checkout

This commit is contained in:
snipe 2017-09-29 17:14:38 -07:00
parent 1a7e3fbb4b
commit be7598b279

View file

@ -179,13 +179,14 @@ class Asset extends Depreciable
public function getDetailedNameAttribute()
{
if ($this->assignedTo) {
$user_name = $this->assignedTo->present()->name();
if ($this->assignedto) {
$user_name = $this->assignedto->present()->name();
} else {
$user_name = "Unassigned";
}
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
}
public function validationRules($id = '0')
{
return $this->rules;