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 c6c4e136
authored
Sep 16, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't clone options in find and findall, since this is taken care of in Utils.format
1 parent
1b7aec39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
10 deletions
lib/dao-factory.js
lib/utils.js
lib/dao-factory.js
View file @
c6c4e13
...
@@ -325,8 +325,6 @@ module.exports = (function() {
...
@@ -325,8 +325,6 @@ module.exports = (function() {
DAOFactory
.
prototype
.
findAll
=
function
(
options
,
queryOptions
)
{
DAOFactory
.
prototype
.
findAll
=
function
(
options
,
queryOptions
)
{
var
hasJoin
=
false
var
hasJoin
=
false
options
=
optClone
(
options
)
if
(
typeof
options
===
'object'
)
{
if
(
typeof
options
===
'object'
)
{
if
(
options
.
hasOwnProperty
(
'include'
))
{
if
(
options
.
hasOwnProperty
(
'include'
))
{
hasJoin
=
true
hasJoin
=
true
...
@@ -379,7 +377,6 @@ module.exports = (function() {
...
@@ -379,7 +377,6 @@ module.exports = (function() {
var
primaryKeys
=
this
.
primaryKeys
var
primaryKeys
=
this
.
primaryKeys
,
keys
=
Object
.
keys
(
primaryKeys
)
,
keys
=
Object
.
keys
(
primaryKeys
)
,
keysLength
=
keys
.
length
,
keysLength
=
keys
.
length
options
=
optClone
(
options
)
// options is not a hash but an id
// options is not a hash but an id
if
(
typeof
options
===
'number'
)
{
if
(
typeof
options
===
'number'
)
{
...
@@ -809,13 +806,6 @@ module.exports = (function() {
...
@@ -809,13 +806,6 @@ module.exports = (function() {
return
attributes
return
attributes
}
}
var
optClone
=
function
(
options
)
{
return
Utils
.
_
.
cloneDeep
(
options
,
function
(
elem
)
{
// The DAOFactories used for include are pass by ref, so don't clone them. Otherwise return undefined, meaning, 'handle this lodash'
return
elem
instanceof
DAOFactory
?
elem
:
undefined
})
}
Utils
.
_
.
extend
(
DAOFactory
.
prototype
,
require
(
"./associations/mixin"
))
Utils
.
_
.
extend
(
DAOFactory
.
prototype
,
require
(
"./associations/mixin"
))
return
DAOFactory
return
DAOFactory
...
...
lib/utils.js
View file @
c6c4e13
...
@@ -55,6 +55,7 @@ var Utils = module.exports = {
...
@@ -55,6 +55,7 @@ var Utils = module.exports = {
},
},
format
:
function
(
arr
,
dialect
)
{
format
:
function
(
arr
,
dialect
)
{
var
timeZone
=
null
;
var
timeZone
=
null
;
// Make a clone of the array beacuse format modifies the passed args
return
SqlString
.
format
(
arr
[
0
],
arr
.
slice
(
1
),
timeZone
,
dialect
)
return
SqlString
.
format
(
arr
[
0
],
arr
.
slice
(
1
),
timeZone
,
dialect
)
},
},
formatNamedParameters
:
function
(
sql
,
parameters
,
dialect
)
{
formatNamedParameters
:
function
(
sql
,
parameters
,
dialect
)
{
...
...
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