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 63f15c3b
authored
Oct 27, 2015
by
mcarboni-redant
Committed by
luin
Feb 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update belongs-to-many.js
1 parent
e71e5201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
lib/associations/belongs-to-many.js
lib/associations/belongs-to-many.js
View file @
63f15c3
...
@@ -445,16 +445,17 @@ BelongsToMany.prototype.injectGetter = function(obj) {
...
@@ -445,16 +445,17 @@ BelongsToMany.prototype.injectGetter = function(obj) {
throughWhere
=
{};
throughWhere
=
{};
throughWhere
[
association
.
foreignKey
]
=
instance
.
get
(
association
.
source
.
primaryKeyAttribute
);
throughWhere
[
association
.
foreignKey
]
=
instance
.
get
(
association
.
source
.
primaryKeyAttribute
);
if
(
options
.
through
&&
options
.
through
.
where
)
throughWhere
=
{
$and
:
[
throughWhere
,
options
.
through
.
where
]};
if
(
through
.
scope
)
{
if
(
through
.
scope
)
{
_
.
assign
(
throughWhere
,
through
.
scope
);
_
.
assign
(
throughWhere
,
through
.
scope
);
}
}
//If a user pass a where on the options through options, make an "and" with the current throughWhere
if
(
options
.
through
&&
options
.
through
.
where
)
{
throughWhere
=
{
$and
:
[
throughWhere
,
options
.
through
.
where
]
};
}
options
.
include
=
options
.
include
||
[];
options
.
include
=
options
.
include
||
[];
options
.
include
.
push
({
options
.
include
.
push
({
association
:
association
.
oneFromTarget
,
association
:
association
.
oneFromTarget
,
...
...
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