Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Saving changes on arrays of references does nothing #1

Open
jakubhomoly opened this issue Mar 24, 2017 · 2 comments
Open

Saving changes on arrays of references does nothing #1

jakubhomoly opened this issue Mar 24, 2017 · 2 comments
Labels

Comments

@jakubhomoly
Copy link
Contributor

jakubhomoly commented Mar 24, 2017

There is a bug right now in the master branch with saving changes to an array of references.

Example:

const CarSchema = new Schema('Car', {
    brand: Type.string(),
    topSpeed: Type.number(),
    taxPaid: Type.boolean(),
    wheels: Type.array(Type.object({
      wheelType: Type.reference(Wheel)
    }))
  })

const Car = settee.buildModel(CarSchema)

settee.registerModels([Car, Wheel])

let bmw = await Car.create({
    brand: 'BMW'
})

bmw.wheels = [
    { wheelType: michelinWheel },
    { wheelType: bridgestoneWheel }
  ]

await bmw.save()

The save() does not store the changes, since this functionality was not completely tested.

With this in mind, we have drafted a fix for this issue in this branch. We will be testing it out for approximately a week, and if everything works out okay, we will merge it with the master branch and create a new release.

@jakubhomoly
Copy link
Contributor Author

After careful review, it seems that this issue is a bit more serious. We will try to deploy a fix as soon as possible.

@Sieabah
Copy link

Sieabah commented Mar 7, 2018

@insanesvk Was it ever fixed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants