mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Some cleaning up.
This commit is contained in:
parent
2998382969
commit
72f04aaedc
@ -3,7 +3,6 @@ Firefly III (v3.2.5)
|
||||
|
||||
[![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii)
|
||||
[![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii)
|
||||
[![Coverage Status](https://coveralls.io/repos/JC5/firefly-iii/badge.png?branch=master)](https://coveralls.io/r/JC5/firefly-iii?branch=master)
|
||||
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102/mini.png)](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102)
|
||||
[![Code Climate](https://codeclimate.com/github/JC5/firefly-iii/badges/gpa.svg)](https://codeclimate.com/github/JC5/firefly-iii)
|
||||
[![Test Coverage](https://codeclimate.com/github/JC5/firefly-iii/badges/coverage.svg)](https://codeclimate.com/github/JC5/firefly-iii)
|
||||
|
@ -331,6 +331,7 @@ class Account implements CUDInterface, CommonDatabaseCallsInterface, AccountInte
|
||||
*/
|
||||
public function validate(array $model)
|
||||
{
|
||||
$model['active'] = !isset($model['active']) ? false : $model['active'];
|
||||
$successes = new MessageBag;
|
||||
$account = new \Account($model);
|
||||
$account->isValid('form_input', false);
|
||||
|
@ -40,7 +40,18 @@ class Helper implements HelperInterface
|
||||
/** @var \FireflyIII\Database\Account\Account $accountRepository */
|
||||
$accountRepository = \App::make('FireflyIII\Database\Account\Account');
|
||||
|
||||
return $accountRepository->getAccountsByType(['Default account', 'Asset account']);
|
||||
/** @var Collection $list */
|
||||
$list = $accountRepository->getAccountsByType(['Default account', 'Asset account']);
|
||||
$filtered = $list->filter(
|
||||
function (\Account $account) {
|
||||
if (intval($account->active) === 1) {
|
||||
return $account;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
return $filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user