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 938aaf50
authored
Jun 16, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3939 from MrVoltz/patch-1
.equals() should compare dataValues directly
2 parents
39e0ce5a
48f41f29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
lib/instance.js
lib/instance.js
View file @
938aaf5
...
@@ -993,12 +993,16 @@ Instance.prototype.decrement = function(fields, options) {
...
@@ -993,12 +993,16 @@ Instance.prototype.decrement = function(fields, options) {
*/
*/
Instance
.
prototype
.
equals
=
function
(
other
)
{
Instance
.
prototype
.
equals
=
function
(
other
)
{
var
result
=
true
;
var
result
=
true
;
if
(
!
other
||
!
other
.
dataValues
)
{
return
false
;
}
Utils
.
_
.
each
(
this
.
dataValues
,
function
(
value
,
key
)
{
Utils
.
_
.
each
(
this
.
dataValues
,
function
(
value
,
key
)
{
if
(
Utils
.
_
.
isDate
(
value
)
&&
Utils
.
_
.
isDate
(
other
[
key
]))
{
if
(
Utils
.
_
.
isDate
(
value
)
&&
Utils
.
_
.
isDate
(
other
.
dataValues
[
key
]))
{
result
=
result
&&
(
value
.
getTime
()
===
other
[
key
].
getTime
());
result
=
result
&&
(
value
.
getTime
()
===
other
.
dataValues
[
key
].
getTime
());
}
else
{
}
else
{
result
=
result
&&
(
value
===
other
[
key
]);
result
=
result
&&
(
value
===
other
.
dataValues
[
key
]);
}
}
});
});
...
...
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