From ae3258b449f553e99ea75dd4c5a43d7f102181db Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 13 Jan 2016 14:01:09 +0100 Subject: [PATCH] If you get the source account attribute before the model is saved, the cache breaks. --- app/Models/TransactionJournal.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 07f4048b47..4e6e3a6dff 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -308,16 +308,8 @@ class TransactionJournal extends Model */ public function getSourceAccountAttribute() { - $cache = new CacheProperties; - $cache->addProperty($this->id); - $cache->addProperty('sourceAccount'); - if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore - } $account = $this->transactions()->where('amount', '<', 0)->first()->account; - $cache->store($account); - return $account; }