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