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
不要怂,就是干,撸起袖子干!
You need to sign in or sign up before continuing.
Commit f189cf27
authored
Jan 18, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
findAll optClone should not fuck with .col/.literal/.fn/.cast - fixes #1249
1 parent
751da171
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletions
lib/dao-factory.js
test/dao-factory/findAll.test.js
lib/dao-factory.js
View file @
f189cf2
...
...
@@ -1426,7 +1426,14 @@ module.exports = (function() {
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
if
(
elem
instanceof
DAOFactory
)
{
return
elem
}
if
(
elem
instanceof
Utils
.
col
||
elem
instanceof
Utils
.
literal
||
elem
instanceof
Utils
.
cast
||
elem
instanceof
Utils
.
fn
)
{
return
elem
}
return
undefined
})
}
...
...
test/dao-factory/findAll.test.js
View file @
f189cf2
...
...
@@ -857,6 +857,22 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
})
it
.
only
(
'should be possible to order by sequelize.col()'
,
function
(
done
)
{
var
self
=
this
var
Company
=
this
.
sequelize
.
define
(
'Company'
,
{
name
:
Sequelize
.
STRING
});
Company
.
sync
().
done
(
function
()
{
Company
.
findAll
({
order
:
[
self
.
sequelize
.
col
(
'name'
)]
}).
done
(
function
(
err
)
{
expect
(
err
).
not
.
to
.
be
.
ok
done
()
})
})
})
})
})
...
...
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