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 f9bb8ae6
authored
Jul 06, 2015
by
Kenneth Kouot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrap options objects in optClone
1 parent
c0795cf0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
lib/model.js
lib/model.js
View file @
f9bb8ae
...
@@ -1236,7 +1236,7 @@ Model.prototype.findById = function(param, options) {
...
@@ -1236,7 +1236,7 @@ Model.prototype.findById = function(param, options) {
return
Promise
.
resolve
(
null
);
return
Promise
.
resolve
(
null
);
}
}
options
=
opt
ions
||
{};
options
=
opt
Clone
(
options
)
||
{};
if
(
typeof
param
===
'number'
||
typeof
param
===
'string'
||
Buffer
.
isBuffer
(
param
))
{
if
(
typeof
param
===
'number'
||
typeof
param
===
'string'
||
Buffer
.
isBuffer
(
param
))
{
options
.
where
=
{};
options
.
where
=
{};
...
@@ -1724,7 +1724,7 @@ Model.prototype.findOrCreate = function(options) {
...
@@ -1724,7 +1724,7 @@ Model.prototype.findOrCreate = function(options) {
* @return {Promise<created>} Returns a boolean indicating whether the row was created or updated.
* @return {Promise<created>} Returns a boolean indicating whether the row was created or updated.
*/
*/
Model
.
prototype
.
upsert
=
function
(
values
,
options
)
{
Model
.
prototype
.
upsert
=
function
(
values
,
options
)
{
options
=
opt
ions
||
{};
options
=
opt
Clone
(
options
)
||
{};
if
(
!
options
.
fields
)
{
if
(
!
options
.
fields
)
{
options
.
fields
=
Object
.
keys
(
this
.
attributes
);
options
.
fields
=
Object
.
keys
(
this
.
attributes
);
...
@@ -1932,7 +1932,7 @@ Model.prototype.bulkCreate = function(records, options) {
...
@@ -1932,7 +1932,7 @@ Model.prototype.bulkCreate = function(records, options) {
* @see {Model#destroy} for more information
* @see {Model#destroy} for more information
*/
*/
Model
.
prototype
.
truncate
=
function
(
options
)
{
Model
.
prototype
.
truncate
=
function
(
options
)
{
options
=
opt
ions
||
{};
options
=
opt
Clone
(
options
)
||
{};
options
.
truncate
=
true
;
options
.
truncate
=
true
;
return
this
.
destroy
(
options
);
return
this
.
destroy
(
options
);
};
};
...
...
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