Fix method to return object, not key.

This commit is contained in:
James Cole 2015-04-28 21:00:26 +02:00
parent deebdd86a6
commit b747c50aa3

View File

@ -77,15 +77,15 @@ class TransactionJournal extends Model
/** @var Transaction $transaction */
foreach ($this->transactions()->get() as $transaction) {
if (floatval($transaction->amount) > 0 && $positive === true) {
return $transaction->account_id;
return $transaction->account;
}
if (floatval($transaction->amount) < 0 && $positive === false) {
return $transaction->account_id;
return $transaction->account;
}
}
return $this->transactions()->first()->account_id;
return $this->transactions()->first();
}
/**