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 62bd98f0
authored
Mar 08, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepend is a no op if theres no tableName so dont mark keys as escaped unless we…
… actually did the work
1 parent
528d8439
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
lib/dialects/abstract/query-generator.js
test/associations/has-many.test.js
lib/dialects/abstract/query-generator.js
View file @
62bd98f
...
@@ -1002,7 +1002,7 @@ module.exports = (function() {
...
@@ -1002,7 +1002,7 @@ module.exports = (function() {
}
}
}
else
if
(
Utils
.
isHash
(
smth
))
{
}
else
if
(
Utils
.
isHash
(
smth
))
{
if
(
prepend
)
{
if
(
prepend
)
{
options
.
keysEscaped
=
true
if
(
tableName
)
options
.
keysEscaped
=
true
smth
=
this
.
prependTableNameToHash
(
tableName
,
smth
)
smth
=
this
.
prependTableNameToHash
(
tableName
,
smth
)
}
}
...
@@ -1019,7 +1019,7 @@ module.exports = (function() {
...
@@ -1019,7 +1019,7 @@ module.exports = (function() {
where
[
primaryKeys
]
=
smth
where
[
primaryKeys
]
=
smth
options
.
keysEscaped
=
true
if
(
tableName
)
options
.
keysEscaped
=
true
smth
=
this
.
prependTableNameToHash
(
tableName
,
where
)
smth
=
this
.
prependTableNameToHash
(
tableName
,
where
)
result
=
this
.
hashToWhereConditions
(
smth
)
result
=
this
.
hashToWhereConditions
(
smth
)
}
else
if
(
typeof
smth
===
"string"
)
{
}
else
if
(
typeof
smth
===
"string"
)
{
...
@@ -1051,9 +1051,7 @@ module.exports = (function() {
...
@@ -1051,9 +1051,7 @@ module.exports = (function() {
var
_hash
=
{}
var
_hash
=
{}
for
(
var
key
in
hash
)
{
for
(
var
key
in
hash
)
{
if
(
key
instanceof
Utils
.
literal
)
{
if
(
key
.
indexOf
(
'.'
)
===
-
1
)
{
_hash
[
key
]
=
hash
[
key
]
}
else
if
(
key
.
indexOf
(
'.'
)
===
-
1
)
{
if
(
tableName
instanceof
Utils
.
literal
)
{
if
(
tableName
instanceof
Utils
.
literal
)
{
_hash
[
tableName
+
'.'
+
this
.
quoteIdentifier
(
key
)]
=
hash
[
key
]
_hash
[
tableName
+
'.'
+
this
.
quoteIdentifier
(
key
)]
=
hash
[
key
]
}
else
{
}
else
{
...
...
test/associations/has-many.test.js
View file @
62bd98f
...
@@ -44,7 +44,8 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
...
@@ -44,7 +44,8 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
Article
.
hasMany
(
Label
)
Article
.
hasMany
(
Label
)
sequelize
.
sync
({
force
:
true
}).
success
(
function
()
{
sequelize
.
sync
({
force
:
true
}).
done
(
function
(
err
)
{
expect
(
err
).
not
.
to
.
be
.
ok
Article
.
create
({
title
:
'foo'
}).
success
(
function
(
article
)
{
Article
.
create
({
title
:
'foo'
}).
success
(
function
(
article
)
{
Label
.
create
({
text
:
'bar'
}).
success
(
function
(
label
)
{
Label
.
create
({
text
:
'bar'
}).
success
(
function
(
label
)
{
sequelize
.
transaction
(
function
(
t
)
{
sequelize
.
transaction
(
function
(
t
)
{
...
...
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