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 4c9d18fd
authored
Apr 08, 2019
by
amitaymolko
Committed by
Sushant
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(query-generator): handle field names in scope include (#10718)
1 parent
75e363ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
lib/dialects/abstract/query-generator.js
test/integration/model/scope/find.test.js
lib/dialects/abstract/query-generator.js
View file @
4c9d18f
...
@@ -1426,6 +1426,8 @@ class QueryGenerator {
...
@@ -1426,6 +1426,8 @@ class QueryGenerator {
// includeIgnoreAttributes is used by aggregate functions
// includeIgnoreAttributes is used by aggregate functions
if (topLevelInfo.options.includeIgnoreAttributes !== false) {
if (topLevelInfo.options.includeIgnoreAttributes !== false) {
include.model._expandAttributes(include);
include.model._expandAttributes(include);
Utils.mapOptionFieldNames(include, include.model);
const includeAttributes = include.attributes.map(attr => {
const includeAttributes = include.attributes.map(attr => {
let attrAs = attr;
let attrAs = attr;
let verbatim = false;
let verbatim = false;
...
...
test/integration/model/scope/find.test.js
View file @
4c9d18f
...
@@ -47,7 +47,11 @@ describe(Support.getTestDialectTeaser('Model'), () => {
...
@@ -47,7 +47,11 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
});
this
.
DefaultScopeExclude
=
this
.
sequelize
.
define
(
'DefaultScopeExclude'
,
{
this
.
DefaultScopeExclude
=
this
.
sequelize
.
define
(
'DefaultScopeExclude'
,
{
name
:
Sequelize
.
STRING
name
:
Sequelize
.
STRING
,
other_value
:
{
type
:
Sequelize
.
STRING
,
field
:
'otherValue'
}
},
{
},
{
defaultScope
:
{
defaultScope
:
{
attributes
:
{
attributes
:
{
...
...
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