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 dee58c69
authored
Mar 04, 2015
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logging for has many setter
1 parent
965f2ee7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
7 deletions
lib/associations/has-many-double-linked.js
lib/associations/has-many-single-linked.js
lib/associations/has-many.js
lib/associations/has-many-double-linked.js
View file @
dee58c6
...
...
@@ -62,8 +62,6 @@ module.exports = (function() {
};
HasManyDoubleLinked
.
prototype
.
injectSetter
=
function
(
oldAssociations
,
newAssociations
,
defaultAttributes
)
{
defaultAttributes
=
defaultAttributes
||
{};
var
self
=
this
,
targetAssociation
=
self
.
association
.
targetAssociation
,
foreignIdentifier
=
self
.
association
.
foreignIdentifier
...
...
lib/associations/has-many-single-linked.js
View file @
dee58c6
...
...
@@ -38,7 +38,7 @@ module.exports = (function() {
,
updateWhere
,
associationKeys
=
Object
.
keys
((
oldAssociations
[
0
]
||
newAssociations
[
0
]
||
{
Model
:
{
primaryKeys
:
{}}}).
Model
.
primaryKeys
||
{})
,
associationKey
=
(
associationKeys
.
length
===
1
)
?
associationKeys
[
0
]
:
'id'
,
options
=
{}
,
options
=
defaultAttributes
,
promises
=
[]
,
obsoleteAssociations
=
oldAssociations
.
filter
(
function
(
old
)
{
return
!
Utils
.
_
.
find
(
newAssociations
,
function
(
obj
)
{
...
...
@@ -52,10 +52,6 @@ module.exports = (function() {
})
,
update
;
if
((
defaultAttributes
||
{}).
transaction
instanceof
Transaction
)
{
options
.
transaction
=
defaultAttributes
.
transaction
;
}
if
(
obsoleteAssociations
.
length
>
0
)
{
// clear the old associations
var
obsoleteIds
=
obsoleteAssociations
.
map
(
function
(
associatedObject
)
{
...
...
lib/associations/has-many.js
View file @
dee58c6
...
...
@@ -403,6 +403,8 @@ module.exports = (function() {
,
primaryKeyAttribute
=
association
.
target
.
primaryKeyAttribute
;
obj
[
this
.
accessors
.
set
]
=
function
(
newAssociatedObjects
,
additionalAttributes
)
{
additionalAttributes
=
additionalAttributes
||
{};
if
(
newAssociatedObjects
===
null
)
{
newAssociatedObjects
=
[];
}
else
{
...
...
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