Move meta relation into trait

This commit is contained in:
James Brooks
2019-02-18 21:56:25 +00:00
parent 827822e22e
commit 88571d7e8f
6 changed files with 60 additions and 55 deletions

View File

@@ -13,6 +13,7 @@ namespace CachetHQ\Cachet\Models;
use AltThree\Validator\ValidatingTrait;
use AltThree\Validator\ValidationException;
use CachetHQ\Cachet\Models\Traits\HasMeta;
use CachetHQ\Cachet\Models\Traits\SortableTrait;
use CachetHQ\Cachet\Presenters\MetricPresenter;
use Illuminate\Database\Eloquent\Builder;
@@ -22,7 +23,9 @@ use McCool\LaravelAutoPresenter\HasPresenter;
class Metric extends Model implements HasPresenter
{
use SortableTrait, ValidatingTrait;
use HasMeta,
SortableTrait,
ValidatingTrait;
/**
* The calculation type of sum.
@@ -165,16 +168,6 @@ class Metric extends Model implements HasPresenter
});
}
/**
* Get the meta relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function meta()
{
return $this->morphMany(Meta::class, 'meta');
}
/**
* Get the points relation.
*