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 cb5bb42d
authored
Nov 17, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly extend default options
1 parent
74ae10c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
lib/model-factory.js
lib/model.js
lib/query.js
lib/model-factory.js
View file @
cb5bb42
...
@@ -7,7 +7,13 @@ module.exports = (function() {
...
@@ -7,7 +7,13 @@ module.exports = (function() {
var
self
=
this
var
self
=
this
this
.
options
=
Utils
.
_
.
extend
({
this
.
options
=
Utils
.
_
.
extend
({
timestamps
:
true
timestamps
:
true
,
instanceMethods
:
undefined
,
classMethods
:
undefined
,
validate
:
undefined
,
freezeTableName
:
false
,
underscored
:
false
,
paranoid
:
false
},
options
||
{})
},
options
||
{})
this
.
name
=
name
this
.
name
=
name
...
...
lib/model.js
View file @
cb5bb42
...
@@ -9,7 +9,12 @@ module.exports = (function() {
...
@@ -9,7 +9,12 @@ module.exports = (function() {
this
.
__definition
=
null
// will be set in Model.build
this
.
__definition
=
null
// will be set in Model.build
this
.
attributes
=
[]
this
.
attributes
=
[]
this
.
validators
=
{}
// holds validation settings for each attribute
this
.
validators
=
{}
// holds validation settings for each attribute
this
.
__options
=
options
||
{}
this
.
__options
=
Utils
.
_
.
extend
({
underscored
:
false
,
hasPrimaryKeys
:
false
,
timestamps
:
true
,
paranoid
:
false
},
options
||
{})
initAttributes
.
call
(
this
,
values
)
initAttributes
.
call
(
this
,
values
)
}
}
...
...
lib/query.js
View file @
cb5bb42
...
@@ -6,7 +6,10 @@ module.exports = (function() {
...
@@ -6,7 +6,10 @@ module.exports = (function() {
this
.
client
=
client
this
.
client
=
client
this
.
callee
=
callee
this
.
callee
=
callee
this
.
options
=
options
||
{}
this
.
options
=
Utils
.
_
.
extend
({
logging
:
true
,
plain
:
false
},
options
||
{})
this
.
bindClientFunction
=
function
(
err
)
{
onFailure
.
call
(
self
,
err
)
}
this
.
bindClientFunction
=
function
(
err
)
{
onFailure
.
call
(
self
,
err
)
}
}
}
Utils
.
addEventEmitter
(
Query
)
Utils
.
addEventEmitter
(
Query
)
...
...
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