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 fef652b7
authored
Apr 23, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(instance): undefined changed should return false
1 parent
4305a37e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
lib/instance.js
test/unit/instance/changed.test.js
test/unit/instance/set.test.js
lib/instance.js
View file @
fef652b
...
...
@@ -410,7 +410,7 @@ module.exports = (function() {
this
.
_changed
[
key
]
=
value
;
return
this
;
}
return
this
.
_changed
[
key
];
return
this
.
_changed
[
key
]
||
false
;
}
var
changed
=
Object
.
keys
(
this
.
dataValues
).
filter
(
function
(
key
)
{
...
...
test/unit/instance/changed.test.js
View file @
fef652b
...
...
@@ -38,7 +38,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
user
.
set
(
'name'
,
'a'
);
expect
(
user
.
changed
(
'name'
)).
not
.
to
.
be
.
ok
;
expect
(
user
.
changed
(
'name'
)).
to
.
equal
(
false
)
;
});
it
(
'should return true for multiple changed values'
,
function
()
{
...
...
test/unit/instance/set.test.js
View file @
fef652b
...
...
@@ -9,7 +9,7 @@ var chai = require('chai')
describe
(
Support
.
getTestDialectTeaser
(
'Instance'
),
function
()
{
describe
(
'set'
,
function
()
{
it
.
only
(
'sets nested keys in JSON objects'
,
function
()
{
it
(
'sets nested keys in JSON objects'
,
function
()
{
var
User
=
this
.
sequelize
.
define
(
'User'
,
{
meta
:
DataTypes
.
JSONB
});
...
...
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