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 a9ceb217
authored
Sep 01, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save passed options without database config
1 parent
476474bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletions
lib/sequelize/Helper.js
lib/sequelize/Sequelize.js
test/SequelizeHelperTest.js
lib/sequelize/Helper.js
View file @
a9ceb21
...
@@ -141,6 +141,14 @@ exports.Helper = function(Sequelize) {
...
@@ -141,6 +141,14 @@ exports.Helper = function(Sequelize) {
target
[
key
]
=
value
target
[
key
]
=
value
})
})
return
target
return
target
},
without
:
function
(
object
,
withoutKeys
)
{
var
result
=
{}
Helper
.
Hash
.
forEach
(
object
,
function
(
value
,
key
)
{
if
(
withoutKeys
.
indexOf
(
key
)
==
-
1
)
result
[
key
]
=
value
})
return
result
}
}
},
},
Array
:
{
Array
:
{
...
...
lib/sequelize/Sequelize.js
View file @
a9ceb21
...
@@ -8,7 +8,7 @@ var Sequelize = function(database, username, password, options) {
...
@@ -8,7 +8,7 @@ var Sequelize = function(database, username, password, options) {
port
:
options
.
port
||
3306
port
:
options
.
port
||
3306
}
}
this
.
tables
=
{}
this
.
tables
=
{}
this
.
options
=
options
this
.
options
=
Sequelize
.
Helper
.
Hash
.
without
(
options
,
[
"host"
,
"port"
])
}
}
var
classMethods
=
{
var
classMethods
=
{
...
...
test/SequelizeHelperTest.js
View file @
a9ceb21
...
@@ -101,5 +101,9 @@ module.exports = {
...
@@ -101,5 +101,9 @@ module.exports = {
},
},
'Inflection: should be available'
:
function
(
assert
)
{
'Inflection: should be available'
:
function
(
assert
)
{
assert
.
isDefined
(
h
.
Inflection
)
assert
.
isDefined
(
h
.
Inflection
)
},
'Hash: without'
:
function
(
assert
)
{
var
hash
=
{
a
:
1
,
b
:
2
}
assert
.
eql
(
h
.
Hash
.
without
(
hash
,
[
"a"
]),
{
b
:
2
})
}
}
}
}
\ No newline at end of file
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