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 78c2475a
authored
Jan 05, 2012
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved getters to the top of the file
1 parent
0aaef45b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
lib/model-factory.js
lib/model-factory.js
View file @
78c2475
...
@@ -26,16 +26,6 @@ module.exports = (function() {
...
@@ -26,16 +26,6 @@ module.exports = (function() {
this
.
validate
=
this
.
options
.
validate
||
{}
this
.
validate
=
this
.
options
.
validate
||
{}
}
}
ModelFactory
.
prototype
.
init
=
function
(
modelManager
)
{
this
.
modelManager
=
modelManager
addDefaultAttributes
.
call
(
this
)
addOptionalClassMethods
.
call
(
this
)
findAutoIncrementField
.
call
(
this
)
return
this
}
Object
.
defineProperty
(
ModelFactory
.
prototype
,
'attributes'
,
{
Object
.
defineProperty
(
ModelFactory
.
prototype
,
'attributes'
,
{
get
:
function
()
{
get
:
function
()
{
return
this
.
QueryGenerator
.
attributesToSQL
(
this
.
rawAttributes
)
return
this
.
QueryGenerator
.
attributesToSQL
(
this
.
rawAttributes
)
...
@@ -50,6 +40,24 @@ module.exports = (function() {
...
@@ -50,6 +40,24 @@ module.exports = (function() {
get
:
function
()
{
return
this
.
QueryInterface
.
QueryGenerator
}
get
:
function
()
{
return
this
.
QueryInterface
.
QueryGenerator
}
})
})
Object
.
defineProperty
(
ModelFactory
.
prototype
,
'primaryKeyCount'
,
{
get
:
function
()
{
return
Utils
.
_
.
keys
(
this
.
primaryKeys
).
length
}
})
Object
.
defineProperty
(
ModelFactory
.
prototype
,
'hasPrimaryKeys'
,
{
get
:
function
()
{
return
this
.
primaryKeyCount
>
0
}
})
ModelFactory
.
prototype
.
init
=
function
(
modelManager
)
{
this
.
modelManager
=
modelManager
addDefaultAttributes
.
call
(
this
)
addOptionalClassMethods
.
call
(
this
)
findAutoIncrementField
.
call
(
this
)
return
this
}
ModelFactory
.
prototype
.
sync
=
function
(
options
)
{
ModelFactory
.
prototype
.
sync
=
function
(
options
)
{
options
=
Utils
.
merge
(
options
||
{},
this
.
options
)
options
=
Utils
.
merge
(
options
||
{},
this
.
options
)
...
@@ -177,14 +185,6 @@ module.exports = (function() {
...
@@ -177,14 +185,6 @@ module.exports = (function() {
return
result
return
result
})
})
ModelFactory
.
prototype
.
__defineGetter__
(
'primaryKeyCount'
,
function
()
{
return
Utils
.
_
.
keys
(
this
.
primaryKeys
).
length
})
ModelFactory
.
prototype
.
__defineGetter__
(
'hasPrimaryKeys'
,
function
()
{
return
this
.
primaryKeyCount
>
0
})
// private
// private
var
query
=
function
()
{
var
query
=
function
()
{
...
...
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