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 b1c0c58a
authored
Sep 15, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(associations/scope): fix a few failing tests
1 parent
7c716215
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
lib/associations/has-many.js
lib/dialects/abstract/query-generator.js
lib/associations/has-many.js
View file @
b1c0c58
...
...
@@ -19,7 +19,7 @@ module.exports = (function() {
this
.
source
=
source
;
this
.
target
=
target
;
this
.
targetAssociation
=
null
;
this
.
options
=
options
;
this
.
options
=
options
||
{}
;
this
.
sequelize
=
source
.
daoFactoryManager
.
sequelize
;
this
.
through
=
options
.
through
;
this
.
scope
=
options
.
scope
;
...
...
@@ -106,9 +106,9 @@ module.exports = (function() {
// If through is not default, determine pairing by through value (model/string)
else
{
paired
=
self
.
options
.
through
===
association
.
options
.
through
||
self
.
options
.
through
===
association
.
options
.
through
.
model
||
self
.
options
.
through
.
model
===
association
.
options
.
through
.
model
||
self
.
options
.
through
.
model
===
association
.
options
.
through
;
self
.
options
.
through
===
(
association
.
options
.
through
&&
association
.
options
.
through
.
model
)
||
(
self
.
options
.
through
&&
self
.
options
.
through
.
model
)
===
(
association
.
options
.
through
&&
association
.
options
.
through
.
model
)
||
(
self
.
options
.
through
&&
self
.
options
.
through
.
model
)
===
association
.
options
.
through
;
}
// If paired, set properties identifying both associations as double linked, and allow them to each eachtoerh
if
(
paired
)
{
...
...
lib/dialects/abstract/query-generator.js
View file @
b1c0c58
...
...
@@ -536,7 +536,7 @@ module.exports = (function() {
// check if model provided is through table
var
association
;
if
(
!
as
&&
parentAssociation
&&
parentAssociation
.
through
===
model
)
{
if
(
!
as
&&
parentAssociation
&&
parentAssociation
.
through
.
model
===
model
)
{
association
=
{
as
:
Utils
.
singularize
(
model
.
tableName
,
model
.
options
.
language
)};
}
else
{
// find applicable association for linking parent to this model
...
...
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