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 b0c7a448
authored
Dec 27, 2013
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dao value rebuilding (should no longer be needed after earlier getter/setter refactor)
1 parent
3afdc41e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
15 deletions
lib/dao.js
test/dao.test.js
lib/dao.js
View file @
b0c7a44
...
@@ -563,20 +563,6 @@ module.exports = (function() {
...
@@ -563,20 +563,6 @@ module.exports = (function() {
this
.
addAttribute
(
key
,
attrs
[
key
])
this
.
addAttribute
(
key
,
attrs
[
key
])
}
}
}
}
// this.addAttributes COMPLETELY destroys the structure of our DAO due to __defineGetter__ resetting the object
// so now we have to rebuild for bulkInserts, bulkUpdates, etc.
var
rebuild
=
{}
// Get the correct map....
Utils
.
_
.
each
(
this
.
attributes
,
function
(
key
)
{
if
(
this
.
dataValues
.
hasOwnProperty
(
key
))
{
rebuild
[
key
]
=
this
.
dataValues
[
key
]
}
}.
bind
(
this
))
// This allows for aliases, etc.
this
.
dataValues
=
Utils
.
_
.
extend
(
rebuild
,
this
.
dataValues
)
}
}
return
DAO
return
DAO
...
...
test/dao.test.js
View file @
b0c7a44
...
@@ -1080,7 +1080,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
...
@@ -1080,7 +1080,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
it
(
'returns a response that can be stringified'
,
function
(
done
)
{
it
(
'returns a response that can be stringified'
,
function
(
done
)
{
var
user
=
this
.
User
.
build
({
username
:
'test.user'
,
age
:
99
,
isAdmin
:
true
})
var
user
=
this
.
User
.
build
({
username
:
'test.user'
,
age
:
99
,
isAdmin
:
true
})
expect
(
JSON
.
stringify
(
user
)).
to
.
deep
.
equal
(
'{"
username":"test.user","age":99,"isAdmin":true,"id":null
}'
)
expect
(
JSON
.
stringify
(
user
)).
to
.
deep
.
equal
(
'{"
id":null,"username":"test.user","age":99,"isAdmin":true
}'
)
done
()
done
()
})
})
...
...
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