When you try to create a model without any behaviour-related(CountedBy, SummedBy, ValuedBy) model. It will throw an error as the observer triggers the increment for the related models.
As we are creating a model without any relation, is expected that the relatedModel() method returns a null value instead of a model.
I've introduced validations around this return type to handle this situation
When you try to create a model without any behaviour-related(CountedBy, SummedBy, ValuedBy) model. It will throw an error as the observer triggers the increment for the related models.
As we are creating a model without any relation, is expected that the
relatedModel()
method returns a null value instead of a model.I've introduced validations around this return type to handle this situation