Skip to content

The changed array does not change after a reload #9594

Closed

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

Activity

  1. added
    type: bug
    on Jun 26, 2018
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

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions