From 8b901084fea6f1015297d01d8f3d946fa7d367ad Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 19 Dec 2014 21:36:53 +0100 Subject: [PATCH] Fixed the tests. --- .../2014_12_13_190730_changes_for_v321.php | 2 +- app/lib/FireflyIII/Database/Account/Account.php | 1 + app/models/Category.php | 15 +++++++++++++++ app/models/Component.php | 15 --------------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/database/migrations/2014_12_13_190730_changes_for_v321.php b/app/database/migrations/2014_12_13_190730_changes_for_v321.php index 6e44cf697a..8d41d878b0 100644 --- a/app/database/migrations/2014_12_13_190730_changes_for_v321.php +++ b/app/database/migrations/2014_12_13_190730_changes_for_v321.php @@ -380,7 +380,7 @@ class ChangesForV321 extends Migration { Schema::table( 'budget_limits', function (Blueprint $table) { - $table->integer('budget_id')->unsigned()->after('updated_at'); + $table->integer('budget_id', false, true)->nullable()->after('updated_at'); $table->foreign('budget_id', 'bid_foreign')->references('id')->on('budgets')->onDelete('cascade'); } ); diff --git a/app/lib/FireflyIII/Database/Account/Account.php b/app/lib/FireflyIII/Database/Account/Account.php index 8be9cf9766..e75ca92b56 100644 --- a/app/lib/FireflyIII/Database/Account/Account.php +++ b/app/lib/FireflyIII/Database/Account/Account.php @@ -14,6 +14,7 @@ use Illuminate\Support\MessageBag; * Class Account * * @package FireflyIII\Database + * @implements FireflyIII\Database\Account\AccountInterface */ class Account implements CUD, CommonDatabaseCalls, AccountInterface { diff --git a/app/models/Category.php b/app/models/Category.php index 2878c29fed..3ead64a97f 100644 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -24,4 +24,19 @@ class Category extends Eloquent { return $this->belongsTo('User'); } + + /** + * remove this method in favour of something in the FireflyIII libraries. + * + * @return Carbon + */ + public function lastActionDate() + { + $transaction = $this->transactionjournals()->orderBy('updated_at', 'DESC')->first(); + if (is_null($transaction)) { + return null; + } + + return $transaction->date; + } } \ No newline at end of file diff --git a/app/models/Component.php b/app/models/Component.php index 726e80e68e..cefdf02627 100644 --- a/app/models/Component.php +++ b/app/models/Component.php @@ -17,19 +17,4 @@ class Component extends Eloquent protected $fillable = ['name', 'user_id','class']; protected $table = 'components'; use ValidatingTrait; - -// /** -// * remove this method in favour of something in the FireflyIII libraries. -// * -// * @return Carbon -// */ -// public function lastActionDate() -// { -// $transaction = $this->transactionjournals()->orderBy('updated_at', 'DESC')->first(); -// if (is_null($transaction)) { -// return null; -// } -// -// return $transaction->date; -// } } \ No newline at end of file