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 7d28d8e6
authored
Oct 30, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added association type for has many associations
1 parent
1b5385ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
lib/associations/has-many.js
lib/associations/has-many.js
View file @
7d28d8e
...
@@ -6,6 +6,7 @@ var HasManySingleLinked = require("./has-many-single-linked")
...
@@ -6,6 +6,7 @@ var HasManySingleLinked = require("./has-many-single-linked")
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
HasMany
=
function
(
srcDAO
,
targetDAO
,
options
)
{
var
HasMany
=
function
(
srcDAO
,
targetDAO
,
options
)
{
this
.
associationType
=
'HasMany'
this
.
source
=
srcDAO
this
.
source
=
srcDAO
this
.
target
=
targetDAO
this
.
target
=
targetDAO
this
.
options
=
options
this
.
options
=
options
...
@@ -53,6 +54,7 @@ module.exports = (function() {
...
@@ -53,6 +54,7 @@ module.exports = (function() {
combinedTableAttributes
[
this
.
foreignIdentifier
]
=
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
}
combinedTableAttributes
[
this
.
foreignIdentifier
]
=
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
}
this
.
connectorDAO
=
this
.
source
.
daoFactoryManager
.
sequelize
.
define
(
this
.
combinedName
,
combinedTableAttributes
,
this
.
options
)
this
.
connectorDAO
=
this
.
source
.
daoFactoryManager
.
sequelize
.
define
(
this
.
combinedName
,
combinedTableAttributes
,
this
.
options
)
if
(
!
this
.
isSelfAssociation
)
{
if
(
!
this
.
isSelfAssociation
)
{
this
.
target
.
associations
[
this
.
associationAccessor
].
connectorDAO
=
this
.
connectorDAO
this
.
target
.
associations
[
this
.
associationAccessor
].
connectorDAO
=
this
.
connectorDAO
}
}
...
...
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