Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 68d729d8
authored
Dec 18, 2017
by
Martin Gutfeldt
Committed by
Sushant
Dec 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(model): set previous values in instances from bulkCreate (#8788)
1 parent
b0bd34df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
lib/model.js
test/integration/instance/values.test.js
lib/model.js
View file @
68d729d
...
@@ -2403,6 +2403,8 @@ class Model {
...
@@ -2403,6 +2403,8 @@ class Model {
instance
.
set
(
attr
,
instance
.
dataValues
[
this
.
rawAttributes
[
attr
].
field
]);
instance
.
set
(
attr
,
instance
.
dataValues
[
this
.
rawAttributes
[
attr
].
field
]);
delete
instance
.
dataValues
[
this
.
rawAttributes
[
attr
].
field
];
delete
instance
.
dataValues
[
this
.
rawAttributes
[
attr
].
field
];
}
}
instance
.
_previousDataValues
[
attr
]
=
instance
.
dataValues
[
attr
];
instance
.
changed
(
attr
,
false
);
}
}
instance
.
isNewRecord
=
false
;
instance
.
isNewRecord
=
false
;
});
});
...
...
test/integration/instance/values.test.js
View file @
68d729d
...
@@ -443,6 +443,11 @@ describe(Support.getTestDialectTeaser('DAO'), () => {
...
@@ -443,6 +443,11 @@ describe(Support.getTestDialectTeaser('DAO'), () => {
expect
(
user
.
changed
(
'name'
)).
to
.
be
.
false
;
expect
(
user
.
changed
(
'name'
)).
to
.
be
.
false
;
expect
(
user
.
changed
()).
not
.
to
.
be
.
ok
;
expect
(
user
.
changed
()).
not
.
to
.
be
.
ok
;
});
});
}).
then
(()
=>
{
return
User
.
bulkCreate
([{
name
:
'Jan Meier'
}]).
spread
(
user
=>
{
expect
(
user
.
changed
(
'name'
)).
to
.
be
.
false
;
expect
(
user
.
changed
()).
not
.
to
.
be
.
ok
;
});
});
});
});
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment