Removed some unnecessary methods.

This commit is contained in:
James Cole 2016-01-15 22:41:26 +01:00
parent f949d2476b
commit 32ed8a4d8d
3 changed files with 2 additions and 21 deletions

View File

@ -2,7 +2,6 @@
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
/**
* FireflyIII\Models\AccountMeta
@ -18,14 +17,7 @@ use Watson\Validating\ValidatingTrait;
class AccountMeta extends Model
{
use ValidatingTrait;
protected $fillable = ['account_id', 'name', 'data'];
protected $rules
= [
'account_id' => 'required|exists:accounts,id',
'name' => 'required|between:1,100',
'data' => 'required',
];
protected $table = 'account_meta';
protected $dates = ['created_at', 'updated_at'];

View File

@ -9,7 +9,6 @@ use FireflyIII\User;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Watson\Validating\ValidatingTrait;
/**
* FireflyIII\Models\Tag
@ -31,18 +30,7 @@ use Watson\Validating\ValidatingTrait;
*/
class Tag extends Model
{
use ValidatingTrait;
protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode'];
protected $rules
= [
'tag' => 'required|min:1',
'description' => 'min:1',
'date' => 'date',
'latitude' => 'numeric|min:-90|max:90',
'longitude' => 'numeric|min:-90|max:90',
'tagMode' => 'required|in:nothing,balancingAct,advancePayment',
];
protected $dates = ['created_at', 'updated_at', 'date'];
/**

View File

@ -323,7 +323,8 @@ class AccountRepository implements AccountRepositoryInterface
{
$journal = TransactionJournal
::orderBy('transaction_journals.date', 'ASC')
->accountIs($account)
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->where('transactions.account_id', $account->id)
->transactionTypes([TransactionType::OPENING_BALANCE])
->orderBy('created_at', 'ASC')
->first(['transaction_journals.*']);