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 ab8ca530
authored
Mar 23, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix nested creation logging
1 parent
0954905f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
lib/instance.js
lib/instance.js
View file @
ab8ca53
...
@@ -595,7 +595,8 @@ module.exports = (function() {
...
@@ -595,7 +595,8 @@ module.exports = (function() {
if
(
!
instance
)
return
Promise
.
resolve
();
if
(
!
instance
)
return
Promise
.
resolve
();
return
instance
.
save
({
return
instance
.
save
({
transaction
:
options
.
transaction
transaction
:
options
.
transaction
,
logging
:
options
.
logging
}).
then
(
function
()
{
}).
then
(
function
()
{
return
self
[
include
.
association
.
accessors
.
set
](
instance
,
{
save
:
false
});
return
self
[
include
.
association
.
accessors
.
set
](
instance
,
{
save
:
false
});
});
});
...
@@ -680,7 +681,7 @@ module.exports = (function() {
...
@@ -680,7 +681,7 @@ module.exports = (function() {
// Instances will be updated in place so we can safely treat HasOne like a HasMany
// Instances will be updated in place so we can safely treat HasOne like a HasMany
return
Promise
.
map
(
instances
,
function
(
instance
)
{
return
Promise
.
map
(
instances
,
function
(
instance
)
{
if
(
include
.
association
instanceof
BelongsToMany
)
{
if
(
include
.
association
instanceof
BelongsToMany
)
{
return
instance
.
save
({
transaction
:
options
.
transaction
,
logging
:
console
.
lo
g
}).
then
(
function
()
{
return
instance
.
save
({
transaction
:
options
.
transaction
,
logging
:
options
.
loggin
g
}).
then
(
function
()
{
var
values
=
{};
var
values
=
{};
values
[
include
.
association
.
foreignKey
]
=
self
.
get
(
self
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
});
values
[
include
.
association
.
foreignKey
]
=
self
.
get
(
self
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
});
values
[
include
.
association
.
otherKey
]
=
instance
.
get
(
instance
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
});
values
[
include
.
association
.
otherKey
]
=
instance
.
get
(
instance
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
});
...
@@ -688,7 +689,7 @@ module.exports = (function() {
...
@@ -688,7 +689,7 @@ module.exports = (function() {
});
});
}
else
{
}
else
{
instance
.
set
(
include
.
association
.
identifier
,
self
.
get
(
self
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
}));
instance
.
set
(
include
.
association
.
identifier
,
self
.
get
(
self
.
Model
.
primaryKeyAttribute
,
{
raw
:
true
}));
return
instance
.
save
({
transaction
:
options
.
transaction
,
logging
:
console
.
lo
g
});
return
instance
.
save
({
transaction
:
options
.
transaction
,
logging
:
options
.
loggin
g
});
}
}
});
});
});
});
...
...
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