vapor / fluent-kit

Swift ORM (queries, models, and relations) for NoSQL and SQL databases
MIT License
214 stars 116 forks source link

Model update not firing #392

Open skyien opened 4 years ago

skyien commented 4 years ago
final class Object: Content {
    let anotherObjects : [AnotherObject]
}

final class Model: Model, Content {
    let objects: [Object]
    ....
}

After updating anotherObjects array, model update not firing. Model.hasChanges indicate false.

Fluent-kit 1.7.3

mkll commented 1 year ago

@skyien As I understand, that's expected behaviour. Fields without changes don't get updated.

To force model update, you need, say, to re-assign [AnotherObject] to anotherObjects.