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 aa946d7b
authored
Sep 20, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Plain Diff
merge
2 parents
ba927c99
4a90430b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
lib/sequelize.js
test/sequelize.test.js
lib/sequelize.js
View file @
aa946d7
...
...
@@ -227,7 +227,7 @@ module.exports = (function() {
}
if
(
!
this
.
importCache
[
path
])
{
var
defineCall
=
require
(
path
)
var
defineCall
=
(
arguments
.
length
>
1
?
arguments
[
1
]
:
require
(
path
)
)
this
.
importCache
[
path
]
=
defineCall
(
this
,
DataTypes
)
}
...
...
test/sequelize.test.js
View file @
aa946d7
...
...
@@ -377,12 +377,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
describe
(
'import'
,
function
()
{
it
(
"imports a dao definition from a file absolute path"
,
function
(
done
)
{
var
Project
=
this
.
sequelize
.
import
(
__dirname
+
"/assets/project"
)
expect
(
Project
).
to
.
exist
done
()
})
it
(
"imports a dao definition from a file relative path"
,
function
(
done
)
{
var
Project
=
this
.
sequelize
.
import
(
"assets/project"
)
it
(
"imports a dao definition from a function"
,
function
(
done
)
{
var
Project
=
this
.
sequelize
.
import
(
'Project'
,
function
(
sequelize
,
DataTypes
)
{
return
sequelize
.
define
(
'Project'
+
parseInt
(
Math
.
random
()
*
9999999999999999
),
{
name
:
DataTypes
.
STRING
})
})
expect
(
Project
).
to
.
exist
done
()
})
...
...
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