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 bf30982c
authored
Mar 04, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminate another loop
1 parent
6c9a76dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
lib/dao-factory.js
lib/dao.js
lib/dao-factory.js
View file @
bf30982
...
@@ -679,6 +679,12 @@ module.exports = (function() {
...
@@ -679,6 +679,12 @@ module.exports = (function() {
}
}
DAOFactory
.
prototype
.
bulkBuild
=
function
(
valueSets
,
options
)
{
DAOFactory
.
prototype
.
bulkBuild
=
function
(
valueSets
,
options
)
{
options
=
options
||
{
isNewRecord
:
true
,
isDirty
:
true
}
if
(
options
.
hasOwnProperty
(
'include'
)
&&
options
.
include
&&
!
options
.
includeValidated
)
{
validateIncludedElements
.
call
(
this
,
options
)
}
return
valueSets
.
map
(
function
(
values
)
{
return
valueSets
.
map
(
function
(
values
)
{
return
this
.
build
(
values
,
options
)
return
this
.
build
(
values
,
options
)
}.
bind
(
this
))
}.
bind
(
this
))
...
@@ -1408,6 +1414,7 @@ module.exports = (function() {
...
@@ -1408,6 +1414,7 @@ module.exports = (function() {
include
.
hasParentRequired
=
options
.
hasParentRequired
||
!!
options
.
required
include
.
hasParentRequired
=
options
.
hasParentRequired
||
!!
options
.
required
options
.
includeMap
[
include
.
as
]
=
include
options
.
includeMap
[
include
.
as
]
=
include
options
.
includeMap
[
include
.
as
.
substr
(
0
,
1
).
toLowerCase
()
+
include
.
as
.
substr
(
1
)]
=
include
options
.
includeNames
.
push
(
include
.
as
)
options
.
includeNames
.
push
(
include
.
as
)
options
.
includeNames
.
push
(
include
.
as
.
substr
(
0
,
1
).
toLowerCase
()
+
include
.
as
.
substr
(
1
))
options
.
includeNames
.
push
(
include
.
as
.
substr
(
0
,
1
).
toLowerCase
()
+
include
.
as
.
substr
(
1
))
...
...
lib/dao.js
View file @
bf30982
...
@@ -215,10 +215,8 @@ module.exports = (function() {
...
@@ -215,10 +215,8 @@ module.exports = (function() {
})
})
}
}
var
include
=
_
.
find
(
this
.
options
.
include
,
function
(
include
)
{
var
include
=
this
.
options
.
includeMap
[
key
]
return
include
.
as
===
key
||
(
include
.
as
.
slice
(
0
,
1
).
toLowerCase
()
+
include
.
as
.
slice
(
1
))
===
key
,
association
=
include
.
association
})
var
association
=
include
.
association
,
self
=
this
,
self
=
this
,
accessor
=
Utils
.
_
.
camelize
(
key
)
,
accessor
=
Utils
.
_
.
camelize
(
key
)
,
childOptions
,
childOptions
...
...
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