Skip to content

updateRecursive and safeUpdateRecursive cannot contain CollectionOfJsonModels in path #13

Description

@jwadhams

Both \Carsdotcom\LaravelJsonModel\JsonModel::updateRecursive and \Carsdotcom\LaravelJsonModel\JsonModel::safeUpdateRecursive correctly descend into JsonModels with JsonModel attributes, but can't transit through a CollectionOfJsonModels. If you're trying to update one property on one collection member, the entire collection member is overwritten instead.

Smart money might be to expose a common interface like SupportsUpdateRecursive that those methods detect, then implement that method on CollectionOfJsonModels. That's the approach we took with CanCascadeEvents

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions