Removed boolean for left join that was never called more than twice anyway.

This commit is contained in:
James Cole 2016-03-02 11:52:17 +01:00
parent b0cc6dd714
commit bf4a7846dd

View File

@ -40,9 +40,6 @@ class TransactionJournal extends Model
'encrypted' => 'required|boolean',
];
/** @var bool */
private $joinedTransactionTypes;
/**
* @param $value
*
@ -307,12 +304,9 @@ class TransactionJournal extends Model
*/
public function scopeTransactionTypes(EloquentBuilder $query, array $types)
{
if (is_null($this->joinedTransactionTypes)) {
$query->leftJoin(
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
);
$this->joinedTransactionTypes = true;
}
$query->leftJoin(
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
);
$query->whereIn('transaction_types.type', $types);
}