From 552bdfdc2db4049b0635fda1b2641772d4555ae5 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 2 Jul 2015 16:51:52 -0700 Subject: [PATCH] Switched defaultLoc to belongsTo relationship --- app/models/Asset.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/Asset.php b/app/models/Asset.php index bef1e91c79..c7e955b7c6 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -58,11 +58,11 @@ class Asset extends Depreciable /** - * Get the asset's location based on the assigned user + * Get the asset's location based on default RTD location **/ public function defaultLoc() { - return $this->hasOne('Location', 'id', 'rtd_location_id'); + return $this->belongsTo('Location', 'rtd_location_id'); } @@ -119,9 +119,9 @@ class Asset extends Depreciable { return $this->belongsTo('Statuslabel','status_id'); } - - /** - * Get name for EULA + + /** + * Get name for EULA **/ public function showAssetName() { @@ -131,7 +131,7 @@ class Asset extends Depreciable return $this->name; } } - + public function warrantee_expires() { $date = date_create($this->purchase_date); @@ -175,7 +175,7 @@ class Asset extends Depreciable { return $this->belongsTo('Supplier','supplier_id'); } - + public function months_until_eol() {