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 78113233
authored
Nov 22, 2013
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the proper key
1 parent
65e36f7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
lib/dao-factory.js
lib/dao-factory.js
View file @
7811323
...
@@ -147,16 +147,15 @@ module.exports = (function() {
...
@@ -147,16 +147,15 @@ module.exports = (function() {
var
opt
=
type
+
'terMethods'
var
opt
=
type
+
'terMethods'
,
funcs
=
Utils
.
_
.
isObject
(
self
.
options
[
opt
])
?
self
.
options
[
opt
]
:
{}
,
funcs
=
Utils
.
_
.
isObject
(
self
.
options
[
opt
])
?
self
.
options
[
opt
]
:
{}
Utils
.
_
.
each
(
self
.
rawAttributes
,
function
(
options
,
attribute
)
{
Utils
.
_
.
each
(
self
.
rawAttributes
,
function
(
attribute
,
name
)
{
if
(
options
.
hasOwnProperty
(
type
))
{
if
(
attribute
.
hasOwnProperty
(
type
))
{
funcs
[
attribute
]
=
options
[
type
]
funcs
[
name
]
=
attribute
[
type
]
}
else
if
(
typeof
funcs
[
attribute
]
===
"undefined"
)
{
}
else
if
(
typeof
funcs
[
name
]
===
"undefined"
)
{
if
(
type
===
'get'
)
{
if
(
type
===
'get'
)
{
funcs
[
nam
e
]
=
function
()
{
return
this
.
dataValues
[
attribute
];
}
funcs
[
attribut
e
]
=
function
()
{
return
this
.
dataValues
[
attribute
];
}
}
}
if
(
type
===
'set'
)
{
if
(
type
===
'set'
)
{
funcs
[
nam
e
]
=
function
(
value
)
{
funcs
[
attribut
e
]
=
function
(
value
)
{
if
(
Utils
.
hasChanged
(
this
.
dataValues
[
attribute
],
value
))
{
if
(
Utils
.
hasChanged
(
this
.
dataValues
[
attribute
],
value
))
{
//Only dirty the object if the change is not due to id, touchedAt, createdAt or updatedAt being initiated
//Only dirty the object if the change is not due to id, touchedAt, createdAt or updatedAt being initiated
var
updatedAtAttr
=
Utils
.
_
.
underscoredIf
(
this
.
__options
.
updatedAt
,
this
.
__options
.
underscored
)
var
updatedAtAttr
=
Utils
.
_
.
underscoredIf
(
this
.
__options
.
updatedAt
,
this
.
__options
.
underscored
)
...
...
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