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 6f882422
authored
Feb 07, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unneeded vars
1 parent
e7d25917
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
lib/dao-factory.js
lib/dao.js
lib/dao-factory.js
View file @
6f88242
...
@@ -180,18 +180,10 @@ module.exports = (function() {
...
@@ -180,18 +180,10 @@ module.exports = (function() {
Util
.
inherits
(
this
.
DAO
,
DAO
);
Util
.
inherits
(
this
.
DAO
,
DAO
);
this
.
_readOnlyAttributes
=
Object
.
keys
(
this
.
_timestampAttributes
)
this
.
_readOnlyAttributes
=
Object
.
keys
(
this
.
_timestampAttributes
)
this
.
DAO
.
prototype
.
_readOnlyAttributes
=
this
.
_readOnlyAttributes
// To be removed
this
.
_hasReadOnlyAttributes
=
this
.
_readOnlyAttributes
&&
this
.
_readOnlyAttributes
.
length
this
.
_hasReadOnlyAttributes
=
this
.
_readOnlyAttributes
&&
this
.
_readOnlyAttributes
.
length
this
.
DAO
.
prototype
.
_hasReadOnlyAttributes
=
this
.
_hasReadOnlyAttributes
// To be removed
this
.
_isReadOnlyAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
this
.
_isReadOnlyAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
return
self
.
_hasReadOnlyAttributes
&&
self
.
_readOnlyAttributes
.
indexOf
(
key
)
!==
-
1
return
self
.
_hasReadOnlyAttributes
&&
self
.
_readOnlyAttributes
.
indexOf
(
key
)
!==
-
1
})
})
this
.
DAO
.
prototype
.
_isReadOnlyAttribute
=
this
.
_isReadOnlyAttribute
// To be removed
this
.
DAO
.
prototype
.
_hasPrimaryKeys
=
this
.
_hasPrimaryKeys
// To be removed
this
.
DAO
.
prototype
.
_isPrimaryKey
=
this
.
_isPrimaryKey
// To be removed
this
.
DAO
.
prototype
.
rawAttributes
=
this
.
rawAttributes
;
this
.
DAO
.
prototype
.
rawAttributes
=
this
.
rawAttributes
;
...
@@ -206,9 +198,6 @@ module.exports = (function() {
...
@@ -206,9 +198,6 @@ module.exports = (function() {
this
.
_booleanAttributes
=
[]
this
.
_booleanAttributes
=
[]
this
.
_dateAttributes
=
[]
this
.
_dateAttributes
=
[]
this
.
_defaultValues
=
{}
this
.
_defaultValues
=
{}
this
.
DAO
.
prototype
.
booleanValues
=
this
.
_booleanAttributes
this
.
DAO
.
prototype
.
dateAttributes
=
this
.
_dateAttributes
this
.
DAO
.
prototype
.
defaultValues
=
this
.
_defaultValues
this
.
DAO
.
prototype
.
validators
=
{}
this
.
DAO
.
prototype
.
validators
=
{}
Utils
.
_
.
each
(
this
.
rawAttributes
,
function
(
definition
,
name
)
{
Utils
.
_
.
each
(
this
.
rawAttributes
,
function
(
definition
,
name
)
{
...
@@ -232,20 +221,15 @@ module.exports = (function() {
...
@@ -232,20 +221,15 @@ module.exports = (function() {
this
.
_isBooleanAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
this
.
_isBooleanAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
return
self
.
_booleanAttributes
.
indexOf
(
key
)
!==
-
1
return
self
.
_booleanAttributes
.
indexOf
(
key
)
!==
-
1
})
})
this
.
DAO
.
prototype
.
_hasBooleanAttributes
=
this
.
_hasBooleanAttributes
this
.
DAO
.
prototype
.
_isBooleanAttribute
=
this
.
_isBooleanAttribute
this
.
_hasDateAttributes
=
!!
this
.
_dateAttributes
.
length
this
.
_hasDateAttributes
=
!!
this
.
_dateAttributes
.
length
this
.
_isDateAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
this
.
_isDateAttribute
=
Utils
.
_
.
memoize
(
function
(
key
)
{
return
self
.
_dateAttributes
.
indexOf
(
key
)
!==
-
1
return
self
.
_dateAttributes
.
indexOf
(
key
)
!==
-
1
})
})
this
.
DAO
.
prototype
.
_hasDateAttributes
=
this
.
_hasDateAttributes
this
.
DAO
.
prototype
.
_isDateAttribute
=
this
.
_isDateAttribute
this
.
DAO
.
prototype
.
Model
=
this
this
.
DAO
.
prototype
.
Model
=
this
this
.
_hasDefaultValues
=
!
Utils
.
_
.
isEmpty
(
this
.
_defaultValues
)
this
.
_hasDefaultValues
=
!
Utils
.
_
.
isEmpty
(
this
.
_defaultValues
)
this
.
DAO
.
prototype
.
hasDefaultValues
=
this
.
_hasDefaultValues
return
this
return
this
}
}
...
...
lib/dao.js
View file @
6f88242
...
@@ -637,8 +637,8 @@ module.exports = (function() {
...
@@ -637,8 +637,8 @@ module.exports = (function() {
values
=
values
&&
_
.
clone
(
values
)
||
{}
values
=
values
&&
_
.
clone
(
values
)
||
{}
if
(
options
.
isNewRecord
)
{
if
(
options
.
isNewRecord
)
{
if
(
this
.
hasDefaultValues
)
{
if
(
this
.
Model
.
_
hasDefaultValues
)
{
Utils
.
_
.
each
(
this
.
defaultValues
,
function
(
valueFn
,
key
)
{
Utils
.
_
.
each
(
this
.
Model
.
_
defaultValues
,
function
(
valueFn
,
key
)
{
if
(
!
defaults
.
hasOwnProperty
(
key
))
{
if
(
!
defaults
.
hasOwnProperty
(
key
))
{
defaults
[
key
]
=
valueFn
()
defaults
[
key
]
=
valueFn
()
}
}
...
...
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