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 a2432384
authored
Aug 18, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Plain Diff
Cleanup in 830
2 parents
ff6a3576
ba3cfab3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
lib/dao-factory.js
lib/dao-factory.js
View file @
a243238
...
@@ -354,15 +354,8 @@ module.exports = (function() {
...
@@ -354,15 +354,8 @@ module.exports = (function() {
DAOFactory
.
prototype
.
findAndCountAll
=
function
(
options
)
{
DAOFactory
.
prototype
.
findAndCountAll
=
function
(
options
)
{
var
self
=
this
var
self
=
this
,
opts
=
Utils
.
_
.
cloneDeep
(
options
)
// no limit, offset, order, attributes or include for the options given to count()
,
copts
=
Utils
.
_
.
extend
({},
Utils
.
_
.
cloneDeep
(
options
)
||
{},
{
,
copts
=
Utils
.
_
.
omit
(
options
||
{},
[
'offset'
,
'limit'
,
'order'
,
'include'
,
'attributes'
])
// no limit, offset, order, attributes or include for the options given to count()
offset
:
0
,
limit
:
0
,
order
:
null
,
include
:
null
,
attributes
:
[]
})
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
var
emit
=
{
var
emit
=
{
...
@@ -378,20 +371,21 @@ module.exports = (function() {
...
@@ -378,20 +371,21 @@ module.exports = (function() {
,
sql
:
function
(
s
)
{
// emit SQL
,
sql
:
function
(
s
)
{
// emit SQL
emitter
.
emit
(
'sql'
,
s
);
emitter
.
emit
(
'sql'
,
s
);
}
}
}
}
self
.
count
(
copts
)
self
.
count
(
copts
)
.
on
(
'sql'
,
emit
.
sql
)
.
on
(
'sql'
,
emit
.
sql
)
.
error
(
emit
.
err
)
.
error
(
emit
.
err
)
.
success
(
function
(
cnt
)
{
.
success
(
function
(
cnt
)
{
if
(
cnt
===
0
)
if
(
cnt
===
0
)
{
return
emit
.
okay
(
cnt
)
// no records, no need for another query
return
emit
.
okay
(
cnt
)
// no records, no need for another query
}
self
.
findAll
(
options
)
self
.
findAll
(
options
)
.
on
(
'sql'
,
emit
.
sql
)
.
on
(
'sql'
,
emit
.
sql
)
.
error
(
emit
.
err
)
.
error
(
emit
.
err
)
.
success
(
function
(
rows
)
{
.
success
(
function
(
rows
)
{
emit
.
okay
(
cnt
,
rows
)
emit
.
okay
(
cnt
,
rows
)
})
})
})
})
...
...
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