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 e9113f35
authored
Mar 21, 2013
by
solotimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #494
1 parent
5788e91a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
lib/dao.js
spec/dao.spec.js
lib/dao.js
View file @
e9113f3
...
@@ -287,7 +287,10 @@ module.exports = (function() {
...
@@ -287,7 +287,10 @@ module.exports = (function() {
,
self
=
this
,
self
=
this
Utils
.
_
.
each
(
this
.
values
,
function
(
value
,
key
)
{
Utils
.
_
.
each
(
this
.
values
,
function
(
value
,
key
)
{
result
=
result
&&
(
value
==
other
[
key
])
if
(
Utils
.
_
.
isDate
(
value
)
&&
Utils
.
_
.
isDate
(
other
[
key
]))
result
=
result
&&
(
value
.
getTime
()
==
other
[
key
].
getTime
())
else
result
=
result
&&
(
value
==
other
[
key
])
})
})
return
result
return
result
...
...
spec/dao.spec.js
View file @
e9113f3
...
@@ -409,4 +409,17 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
...
@@ -409,4 +409,17 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
}.
bind
(
this
))
}.
bind
(
this
))
})
})
})
})
describe
(
'equals'
,
function
find
()
{
it
(
"can compare records with Date field"
,
function
(
done
)
{
this
.
User
.
create
({
username
:
'fnord'
}).
success
(
function
(
user1
)
{
var
query
=
{
where
:
{
username
:
'fnord'
}}
this
.
User
.
find
(
query
).
success
(
function
(
user2
)
{
expect
(
user1
.
equals
(
user2
)).
toEqual
(
true
)
done
()
}.
bind
(
this
))
}.
bind
(
this
))
})
})
})
})
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