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 35683cfe
authored
Aug 20, 2015
by
Clement Teule
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #4353. After destroy and reload, a 1-1 association is set to null.
1 parent
f2d2beaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
lib/instance.js
lib/instance.js
View file @
35683cf
...
...
@@ -312,7 +312,7 @@ Instance.prototype.set = function(key, value, options) { // testhint options:non
}
else
{
// Check if we have included models, and if this key matches the include model names/aliases
if
(
this
.
options
&&
this
.
options
.
include
&&
this
.
options
.
includeNames
.
indexOf
(
key
)
!==
-
1
&&
value
)
{
if
(
this
.
options
&&
this
.
options
.
include
&&
this
.
options
.
includeNames
.
indexOf
(
key
)
!==
-
1
)
{
// Pass it on to the include handler
this
.
_setInclude
(
key
,
value
,
options
);
return
;
...
...
@@ -454,7 +454,7 @@ Instance.prototype._setInclude = function(key, value, options) {
value
=
value
[
0
];
}
isEmpty
=
value
&&
value
[
primaryKeyAttribute
]
===
null
;
isEmpty
=
(
value
&&
value
[
primaryKeyAttribute
]
===
null
)
||
(
value
===
null
)
;
self
[
accessor
]
=
self
.
dataValues
[
accessor
]
=
isEmpty
?
null
:
include
.
model
.
build
(
value
,
childOptions
);
}
else
{
isEmpty
=
value
[
0
]
&&
value
[
0
][
primaryKeyAttribute
]
===
null
;
...
...
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