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 e5d1d00d
authored
May 07, 2015
by
Ruben Bridgewater
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation message
1 parent
d1cb281e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
test/integration/associations/belongs-to-many.test.js
test/integration/include/findAll.test.js
test/integration/associations/belongs-to-many.test.js
View file @
e5d1d00
...
...
@@ -1888,8 +1888,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() {
}
});
var
UserProjects
=
User
.
belongsToMany
(
Project
,
{
foreignKey
:
{
name
:
'user_id'
,
defaultValue
:
42
}});
var
UserProjects
=
User
.
belongsToMany
(
Project
,
{
foreignKey
:
{
name
:
'user_id'
,
defaultValue
:
42
},
through
:
'UserProjects'
});
expect
(
UserProjects
.
through
.
model
.
rawAttributes
.
user_id
).
to
.
be
.
ok
;
expect
(
UserProjects
.
through
.
model
.
rawAttributes
.
user_id
.
references
).
to
.
equal
(
User
.
getTableName
());
expect
(
UserProjects
.
through
.
model
.
rawAttributes
.
user_id
.
referencesKey
).
to
.
equal
(
'uid'
);
...
...
@@ -1902,7 +1901,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() {
user
:
Sequelize
.
INTEGER
});
expect
(
User
.
belongsToMany
.
bind
(
User
,
User
,
{
as
:
'user'
})).
to
expect
(
User
.
belongsToMany
.
bind
(
User
,
User
,
{
as
:
'user'
,
through
:
'UserUser'
})).
to
.
throw
(
'Naming collision between attribute \'user\' and association \'user\' on model user. To remedy this, change either foreignKey or as in your association definition'
);
});
});
...
...
test/integration/include/findAll.test.js
View file @
e5d1d00
...
...
@@ -1817,8 +1817,8 @@ describe(Support.getTestDialectTeaser('Include'), function() {
,
Group
=
this
.
sequelize
.
define
(
'Group'
,
{});
User
.
belongsTo
(
Company
);
User
.
belongsToMany
(
Group
);
Group
.
belongsToMany
(
User
);
User
.
belongsToMany
(
Group
,
{
through
:
'UsersGroups'
}
);
Group
.
belongsToMany
(
User
,
{
through
:
'UsersGroups'
}
);
return
this
.
sequelize
.
sync
({
force
:
true
}).
then
(
function
()
{
return
User
.
findAll
({
...
...
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