From be7598b27956f15900959eee630bc8c5668c5647 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 29 Sep 2017 17:14:38 -0700 Subject: [PATCH] Fixes all assets showing as unassigned in license checkout --- app/Models/Asset.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index ffda8141e8..2f7d221157 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -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;