Skip to content

Firefly III: a personal finances manager

Removed some unnecessary methods.

James Cole32ed8a4d8d1a
diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php
index 652f6a116e..5b23dd2533 100644
--- a/app/Models/AccountMeta.php
+++ b/app/Models/AccountMeta.php
@@ -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'];
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index 2fb076cc1d..f9894ef980 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -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'];
/**
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index 94d4ae59e4..6a9ebf260b 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -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.*']);