mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Model tests.
This commit is contained in:
@@ -38,14 +38,9 @@ class Component extends Firefly\Database\SingleTableInheritanceEntity
|
||||
protected $table = 'components';
|
||||
protected $subclassField = 'class';
|
||||
|
||||
public function transactions()
|
||||
{
|
||||
return $this->belongsToMany('Transaction');
|
||||
}
|
||||
|
||||
public function limits()
|
||||
{
|
||||
return $this->belongsTo('Limit');
|
||||
return $this->hasMany('Limit');
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
@@ -53,6 +48,11 @@ class Component extends Firefly\Database\SingleTableInheritanceEntity
|
||||
return $this->belongsToMany('TransactionJournal');
|
||||
}
|
||||
|
||||
public function transactions()
|
||||
{
|
||||
return $this->belongsToMany('Transaction');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('User');
|
||||
|
@@ -105,11 +105,14 @@ class Limit extends Ardent
|
||||
try {
|
||||
$repetition->save();
|
||||
\Log::debug('Created new repetition with id #' . $repetition->id);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (QueryException $e) {
|
||||
// do nothing
|
||||
|
||||
\Log::error('Trying to save new Limitrepetition failed!');
|
||||
\Log::error($e->getMessage());
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +121,7 @@ class Limit extends Ardent
|
||||
return $this->hasMany('LimitRepetition');
|
||||
}
|
||||
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||
|
Reference in New Issue
Block a user