Skip to content

populateBelongsToAttribute should not throw exceptions #47

@vercotux

Description

@vercotux

When a parent has non-saved BELONGS_TO relations populateBelongsToAttribute will throw an exception saying "You can not save a record that has new related records!".

This is a big problem when we are dealing with mandatory relations. If the child is saved, we should be good to go, but if it is not, the validation should warn us about a missing mandatory field. This currently cannot happen because the validation is being interrupted by the exception.

The solution is to do nothing when the child relation is not saved and let the validation take care of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions