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 e71e5201
authored
Oct 27, 2015
by
mcarboni-redant
Committed by
luin
Feb 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for Model.getAssociatedModel({ through : { where : { ... } }})
1 parent
ae89e846
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
lib/associations/belongs-to-many.js
lib/associations/belongs-to-many.js
View file @
e71e520
...
@@ -445,6 +445,12 @@ BelongsToMany.prototype.injectGetter = function(obj) {
...
@@ -445,6 +445,12 @@ 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
);
}
}
...
...
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