remove ref counting, will be replaced by cleanup jobs or triggers

This commit is contained in:
2018-07-22 06:47:59 +02:00
parent e01c63cfa2
commit 9081b38425
7 changed files with 3 additions and 53 deletions
-16
View File
@@ -25,22 +25,6 @@ class Proposal extends Model
use Reportable;
protected $guarded = [];
protected static function boot()
{
parent::boot();
static::deleting(function(Proposal $self) {
$self->reportsOf()->delete();
// update refcounts
$rev = $self->revision;
$rev->decrement('refs');
// Delete the revision if it has no other refs (manually, to update row refs)
if ($rev->refs <= 0) $rev->delete();
});
}
/** Authoring user */
public function author()
{