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 27987383
authored
May 07, 2015
by
Ruben Bridgewater
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression introduced in 2.1.2
1 parent
8ec1bf5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
2 deletions
changelog.md
lib/model.js
lib/utils.js
test/integration/model/update.test.js
changelog.md
View file @
2798738
# next
-
[
BUG
]
Fix regression introduced in 2.1.2: updatedAt not set anymore
# 2.1.2
# 2.1.2
-
[
BUG
]
`Model.create()/update()`
no longer attempts to save undefined fields.
-
[
BUG
]
`Model.create()/update()`
no longer attempts to save undefined fields.
...
...
lib/model.js
View file @
2798738
...
@@ -1630,7 +1630,11 @@ module.exports = (function() {
...
@@ -1630,7 +1630,11 @@ module.exports = (function() {
}
}
});
});
}
else
{
}
else
{
var
updatedAtAttr
=
this
.
_timestampAttributes
.
updatedAt
;
options
.
fields
=
_
.
intersection
(
Object
.
keys
(
values
),
Object
.
keys
(
this
.
tableAttributes
));
options
.
fields
=
_
.
intersection
(
Object
.
keys
(
values
),
Object
.
keys
(
this
.
tableAttributes
));
if
(
updatedAtAttr
&&
options
.
fields
.
indexOf
(
updatedAtAttr
)
===
-
1
)
{
options
.
fields
.
push
(
updatedAtAttr
);
}
}
}
if
(
this
.
_timestampAttributes
.
updatedAt
)
{
if
(
this
.
_timestampAttributes
.
updatedAt
)
{
...
...
lib/utils.js
View file @
2798738
...
@@ -164,7 +164,6 @@ var Utils = module.exports = {
...
@@ -164,7 +164,6 @@ var Utils = module.exports = {
fields
.
forEach
(
function
(
attr
)
{
fields
.
forEach
(
function
(
attr
)
{
if
(
dataValues
[
attr
]
!==
undefined
&&
!
Model
.
_isVirtualAttribute
(
attr
))
{
if
(
dataValues
[
attr
]
!==
undefined
&&
!
Model
.
_isVirtualAttribute
(
attr
))
{
values
[
attr
]
=
dataValues
[
attr
];
values
[
attr
]
=
dataValues
[
attr
];
// Field name mapping
// Field name mapping
if
(
Model
.
rawAttributes
[
attr
]
&&
Model
.
rawAttributes
[
attr
].
field
&&
Model
.
rawAttributes
[
attr
].
field
!==
attr
)
{
if
(
Model
.
rawAttributes
[
attr
]
&&
Model
.
rawAttributes
[
attr
].
field
&&
Model
.
rawAttributes
[
attr
].
field
!==
attr
)
{
...
...
test/integration/model/update.test.js
View file @
2798738
...
@@ -18,7 +18,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -18,7 +18,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
}
}
});
});
return
Account
.
sync
({
force
:
true
,
logging
:
console
.
log
}).
then
(
function
()
{
return
Account
.
sync
({
force
:
true
}).
then
(
function
()
{
return
Account
.
create
({
return
Account
.
create
({
ownerId
:
2
ownerId
:
2
}).
then
(
function
(
account
)
{
}).
then
(
function
(
account
)
{
...
...
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