remove ref counting, will be replaced by cleanup jobs or triggers
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user