Skip to content

Firefly III: a personal finances manager

If you get the source account attribute before the model is saved, the cache breaks.

James Coleae3258b449f5
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;
}