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 a7946541
authored
Oct 27, 2014
by
overlookmotel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
var declarations moved out of loop
1 parent
5a44304b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
lib/dialects/abstract/query-generator.js
lib/dialects/abstract/query-generator.js
View file @
a794654
...
@@ -536,14 +536,17 @@ module.exports = (function() {
...
@@ -536,14 +536,17 @@ module.exports = (function() {
// (checking associations to see if names should be singularised or not)
// (checking associations to see if names should be singularised or not)
var
tableNames
=
[]
var
tableNames
=
[]
,
parentAssociation
,
parentAssociation
,
len
=
obj
.
length
;
,
len
=
obj
.
length
,
item
,
model
,
as
,
association
;
for
(
var
i
=
0
;
i
<
len
-
1
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
-
1
;
i
++
)
{
var
item
=
obj
[
i
];
item
=
obj
[
i
];
if
(
item
.
_modelAttribute
||
Utils
.
_
.
isString
(
item
)
||
item
.
_isSequelizeMethod
||
'raw'
in
item
)
{
if
(
item
.
_modelAttribute
||
Utils
.
_
.
isString
(
item
)
||
item
.
_isSequelizeMethod
||
'raw'
in
item
)
{
break
;
break
;
}
}
var
model
,
as
;
if
(
item
instanceof
Model
)
{
if
(
item
instanceof
Model
)
{
model
=
item
;
model
=
item
;
as
=
undefined
;
as
=
undefined
;
...
@@ -553,7 +556,6 @@ module.exports = (function() {
...
@@ -553,7 +556,6 @@ module.exports = (function() {
}
}
// check if model provided is through table
// check if model provided is through table
var
association
;
if
(
!
as
&&
parentAssociation
&&
parentAssociation
.
through
.
model
===
model
)
{
if
(
!
as
&&
parentAssociation
&&
parentAssociation
.
through
.
model
===
model
)
{
association
=
{
as
:
Utils
.
singularize
(
model
.
tableName
,
model
.
options
.
language
)};
association
=
{
as
:
Utils
.
singularize
(
model
.
tableName
,
model
.
options
.
language
)};
}
else
{
}
else
{
...
...
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