Skip to content

Activerecord-Import imports associations for invalid models #857

@jacob-carlborg-apoex

Description

@jacob-carlborg-apoex

When importing models with associations and the main model fails to validate, Activerecord-Import will import the associations anyway. This is with the recursive: true option.

The problem is here:

import_associations(models, options.dup.merge(validate: false))

The models that failed to validate need to be filtered out from the models variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions