mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
More unit tests.
This commit is contained in:
@@ -148,14 +148,4 @@ class PiggyBank extends Eloquent
|
||||
{
|
||||
return $this->morphMany('Reminder', 'remindersable');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasMany('Transaction');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class PiggyBankRepetition extends Eloquent
|
||||
*/
|
||||
public function scopeStarts(Builder $query, Carbon $date)
|
||||
{
|
||||
$query->where('startdate', $date->format('Y-m-d'));
|
||||
$query->where('startdate', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ class PiggyBankRepetition extends Eloquent
|
||||
*/
|
||||
public function scopeTargets(Builder $query, Carbon $date)
|
||||
{
|
||||
$query->where('targetdate', $date->format('Y-m-d'));
|
||||
$query->where('targetdate', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,16 +12,6 @@ class Reminder extends Eloquent
|
||||
|
||||
protected $table = 'reminders';
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDataAttribute($value)
|
||||
{
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -49,15 +39,7 @@ class Reminder extends Eloquent
|
||||
*/
|
||||
public function scopeDateIs($query, Carbon $start, Carbon $end)
|
||||
{
|
||||
return $query->where('startdate', $start->format('Y-m-d'))->where('enddate', $end->format('Y-m-d'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*/
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
return $query->where('startdate', $start->format('Y-m-d 00:00:00'))->where('enddate', $end->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,15 +26,6 @@ class Transaction extends Eloquent
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('PiggyBank');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Builder $query
|
||||
* @param Account $account
|
||||
|
||||
Reference in New Issue
Block a user