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 42e6cb5a
authored
May 17, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
1 parent
f4cb4405
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
lib/query-interface.js
test/integration/dialects/mysql/associations.test.js
test/integration/dialects/postgres/associations.test.js
test/integration/timezone.test.js
lib/query-interface.js
View file @
42e6cb5
...
...
@@ -126,7 +126,7 @@ module.exports = (function() {
return
Promise
.
all
(
promises
).
then
(
function
(
results
)
{
var
promises
=
[]
,
instanceTable
=
self
.
sequelize
.
instanceFactory
Manager
.
instances
.
filter
(
function
(
instance
)
{
return
instance
.
tableName
===
tableName
;
})
,
instanceTable
=
self
.
sequelize
.
model
Manager
.
instances
.
filter
(
function
(
instance
)
{
return
instance
.
tableName
===
tableName
;
})
,
enumIdx
=
0
;
instanceTable
=
instanceTable
.
length
>
0
?
instanceTable
[
0
]
:
null
;
...
...
test/integration/dialects/mysql/associations.test.js
View file @
42e6cb5
...
...
@@ -19,7 +19,7 @@ if (Support.dialectIsMySQL()) {
Table2
.
belongsToMany
(
Table1
,
{
through
:
'wp_table1swp_table2s'
});
return
Table1
.
sync
({
force
:
true
}).
then
(
function
()
{
return
Table2
.
sync
({
force
:
true
}).
then
(
function
()
{
expect
(
self
.
sequelize
.
modelManager
.
get
DAO
(
'wp_table1swp_table2s'
)).
to
.
exist
;
expect
(
self
.
sequelize
.
modelManager
.
get
Model
(
'wp_table1swp_table2s'
)).
to
.
exist
;
});
});
});
...
...
@@ -38,8 +38,8 @@ if (Support.dialectIsMySQL()) {
});
it
(
'should not use only a specified name'
,
function
()
{
expect
(
this
.
sequelize
.
modelManager
.
get
DAO
(
'ms_table1sms_table2s'
)).
not
.
to
.
exist
;
expect
(
this
.
sequelize
.
modelManager
.
get
DAO
(
'table1_to_table2'
)).
to
.
exist
;
expect
(
this
.
sequelize
.
modelManager
.
get
Model
(
'ms_table1sms_table2s'
)).
not
.
to
.
exist
;
expect
(
this
.
sequelize
.
modelManager
.
get
Model
(
'table1_to_table2'
)).
to
.
exist
;
});
});
});
...
...
@@ -74,7 +74,7 @@ if (Support.dialectIsMySQL()) {
});
});
describe
(
'addDAO / get
DAO
'
,
function
()
{
describe
(
'addDAO / get
Model
'
,
function
()
{
beforeEach
(
function
()
{
var
self
=
this
;
...
...
test/integration/dialects/postgres/associations.test.js
View file @
42e6cb5
...
...
@@ -19,7 +19,7 @@ if (dialect.match(/^postgres/)) {
Table1
.
belongsToMany
(
Table2
,
{
through
:
'wp_table1swp_table2s'
});
Table2
.
belongsToMany
(
Table1
,
{
through
:
'wp_table1swp_table2s'
});
expect
(
this
.
sequelize
.
daoFactory
Manager
.
getModel
(
'wp_table1swp_table2s'
)).
to
.
exist
;
expect
(
this
.
sequelize
.
model
Manager
.
getModel
(
'wp_table1swp_table2s'
)).
to
.
exist
;
});
});
...
...
@@ -33,11 +33,11 @@ if (dialect.match(/^postgres/)) {
});
it
(
'should not use a combined name'
,
function
()
{
expect
(
this
.
sequelize
.
daoFactory
Manager
.
getModel
(
'ms_table1sms_table2s'
)).
not
.
to
.
exist
;
expect
(
this
.
sequelize
.
model
Manager
.
getModel
(
'ms_table1sms_table2s'
)).
not
.
to
.
exist
;
});
it
(
'should use the specified name'
,
function
()
{
expect
(
this
.
sequelize
.
daoFactory
Manager
.
getModel
(
'table1_to_table2'
)).
to
.
exist
;
expect
(
this
.
sequelize
.
model
Manager
.
getModel
(
'table1_to_table2'
)).
to
.
exist
;
});
});
});
...
...
test/integration/timezone.test.js
View file @
42e6cb5
...
...
@@ -64,7 +64,7 @@ if (dialect !== 'sqlite') {
return
TimezonedUser
.
create
({});
}).
then
(
function
(
timezonedUser
)
{
this
.
timezonedUser
=
timezonedUser
;
return
NormalUser
.
find
(
timezonedUser
.
id
);
return
NormalUser
.
find
ById
(
timezonedUser
.
id
);
}).
then
(
function
(
normalUser
)
{
// Expect 5 hours difference, in milliseconds, +/- 1 hour for DST
expect
(
normalUser
.
createdAt
.
getTime
()
-
this
.
timezonedUser
.
createdAt
.
getTime
()).
to
.
be
.
closeTo
(
60
*
60
*
4
*
1000
*
-
1
,
60
*
60
*
1000
);
...
...
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