Skip to content

The changed array does not change after a reload #9594

@david4City

Description

@david4City

What are you doing?

const person = await Person.findOne(); // firstName: 'henri'
person.firstName = 'henriette'
console.log(person.changed()) // ['firstName']
await person.reload()
console.log(person.changed()) // ['firstName']
await person.save() // UPDATE `persons` SET `firstName`='henri',`updatedAt`='2018-06-26 09:45:58' WHERE `id` = '1dzokreaa3v'

What do you expect to happen?

  • After reload has been called person.changed() should be false
  • person.save() should not launch an UPDATE query

What is actually happening?

Dialect: mysql
Sequelize version:^4.38.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions