Fixed the tests.

This commit is contained in:
James Cole 2014-12-19 21:36:53 +01:00
parent 1a0cbbdb31
commit 8b901084fe
4 changed files with 17 additions and 16 deletions

View File

@ -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');
}
);

View File

@ -14,6 +14,7 @@ use Illuminate\Support\MessageBag;
* Class Account
*
* @package FireflyIII\Database
* @implements FireflyIII\Database\Account\AccountInterface
*/
class Account implements CUD, CommonDatabaseCalls, AccountInterface
{

View File

@ -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;
}
}

View File

@ -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;
// }
}