octobercms / docs

The October CMS Documentation
Other
175 stars 227 forks source link

Inconsistent documentation regarding relation definition options #591

Closed kff5000 closed 1 year ago

kff5000 commented 1 year ago

On https://docs.octobercms.com/3.x/extend/database/traits.html#soft-deleting-relations

it says:

Soft Deleting Relations When two related models have soft deletes enabled, you can cascade the delete event by defining the softDelete option in the relation definition. In this example, if the user model is soft deleted, the comments belonging to that user will also be soft deleted.

class User extends Model
{
    use \October\Rain\Database\Traits\SoftDelete;

    public $hasMany = [
        'comments' => [\Acme\Blog\Models\Comment::class, 'softDelete' => true]
    ];
}

But on the linked https://docs.octobercms.com/3.x/extend/database/relations.html no softDelete argument is listed. Only delete. I guess softDelete should get mentioned there as well (?)

daftspunk commented 1 year ago

Nice find.

It is fixed in: https://github.com/octobercms/docs/commit/437e981cc04d19fdb60ac22d783d8ffaa17379d7

Thanks!