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 e620b7d7
authored
Sep 11, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(model/find): fix issues and remove poor test
1 parent
484bc574
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
23 deletions
lib/model.js
test/include/paranoid.test.js
lib/model.js
View file @
e620b7d
...
@@ -738,7 +738,7 @@ module.exports = (function() {
...
@@ -738,7 +738,7 @@ module.exports = (function() {
}
}
var
options
=
{};
var
options
=
{};
if
(
typeof
param
===
'number'
||
typeof
param
===
'string'
)
{
if
(
typeof
param
===
'number'
||
typeof
param
===
'string'
||
Buffer
.
isBuffer
(
param
)
)
{
options
.
where
=
{};
options
.
where
=
{};
options
.
where
[
this
.
primaryKeyAttribute
]
=
param
;
options
.
where
[
this
.
primaryKeyAttribute
]
=
param
;
}
else
{
}
else
{
...
@@ -1904,7 +1904,8 @@ module.exports = (function() {
...
@@ -1904,7 +1904,8 @@ module.exports = (function() {
(
(
elem
.
_isSequelizeMethod
||
elem
.
_isSequelizeMethod
||
elem
instanceof
Model
||
elem
instanceof
Model
||
elem
instanceof
Transaction
elem
instanceof
Transaction
||
elem
instanceof
Association
)
)
)
{
)
{
return
elem
;
return
elem
;
...
...
test/include/paranoid.test.js
View file @
e620b7d
...
@@ -58,27 +58,6 @@ describe(Support.getTestDialectTeaser("Paranoid"), function () {
...
@@ -58,27 +58,6 @@ describe(Support.getTestDialectTeaser("Paranoid"), function () {
})
})
it
(
'test if default required behavior is marked as false'
,
function
(
done
)
{
var
A
=
this
.
A
,
B
=
this
.
B
,
options
=
{
include
:
[
{
model
:
B
,
}
],
}
A
.
find
(
options
).
done
(
function
(
err
)
{
expect
(
err
).
not
.
to
.
be
.
ok
expect
(
options
.
include
[
0
].
required
).
to
.
be
.
equal
(
false
)
done
()
})
})
it
(
'test if non required is marked as false'
,
function
(
done
)
{
it
(
'test if non required is marked as false'
,
function
(
done
)
{
var
A
=
this
.
A
,
var
A
=
this
.
A
,
...
...
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